简体   繁体   English

joomla 2.5默认隐藏模块标题

[英]Hide the title of module by default in joomla 2.5

I am working on module of joomla 2.5.我正在研究 joomla 2.5 的模块。 I have created the module but i need to hide the title of module by default , The nature of joomla backend is that it sets the show title to 'show' by default .我已经创建了模块,但默认情况下我需要隐藏模块的标题,joomla 后端的性质是它默认将显示标题设置为“显示”。 I need to change to 'hide' by default.默认情况下,我需要更改为“隐藏”。 The best possible solution i have come up with changing the field 'showtitle' to '0' from module table in db.我想出的最佳解决方案是将 db 中的模块表中的字段“showtitle”更改为“0”。

$db = JFactory::getDBO();
$query = $db->getQuery(true);
$query->update('#__modules AS a');
$query->set('a.showtitle = 0');
$query->where('a.module = "mod_name"');
$db->setQuery($query);
$db->query();

I am not sure , whether this is the best way , If any joomla pro has better way to achieve the task , Please suggest .我不确定,这是否是最好的方法,如果任何 joomla pro 有更好的方法来完成任务,请提出建议。

Thank you.谢谢你。

You can do this with changing your template code, in your template you find a code which include module in to template您可以通过更改模板代码来做到这一点,在您的模板中,您可以找到将模块包含在模板中的代码

<jdoc:include type="modules" name="position-1" style="xhtml" />

change this code to将此代码更改为

<jdoc:include type="modules" name="position-1" style="none" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM