简体   繁体   中英

Hide the title of module by default in joomla 2.5

I am working on module of 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 . 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 = 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 .

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" />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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