手动控制< head> Joomla中的标记 [英] Manually control <head> markup in Joomla
问题描述
是否可以在Joomla 3.1中手动配置网站的<head>
部分的内容?我想在页面的整个标记中使用模板系统,包括<html></html>
之间的所有内容.
Is there a way to manually configure the contents of the <head>
section of the site in Joomla 3.1? I want to use the templating system for the entire markup of the page, including everything between <html></html>
.
我刚刚读了这篇文章: http://forum.joomla.org /viewtopic.php?f=466&t=230787 ,我很惊讶.当然,这是模板/数据分离101.在最新的Joomla版本中是否已解决此问题?
I just read this: http://forum.joomla.org/viewtopic.php?f=466&t=230787 and I am astonished at the response. Surely this is template/data separation 101. Has this been fixed in the latest Joomla release?
推荐答案
如果您打算进行模板开发,并且需要将所有模板数据与Joomla库或核心文件(头部)分开.
If you are planning for a template development and you need all your template data get separated from Joomla libraries or core file (the head section).
通常,头部的include会像
Normally the head section include will works like
<jdoc:include type="head" />
它从库libraries\joomla\document\html\renderer\head.php
如果要覆盖head的内容,可以为您的任务创建一个模块.
只需创建一个模块并包括该模块(而不是该模块),以确保已添加了所有必需的代码即可使用$document
类,否则,它会遗漏许多有关document class
If you want to override the content of head you can make a module for your task.
Just create a module and include that module instead of this head make sure that have all required codes added to work $document
Class otherwise it miss a lot off features of Joomla regarding document class
这篇关于手动控制< head> Joomla中的标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!