How can I control what title tag information is displayed for <{$xoops_pagetitle}> in the header.php?

Requested and Answered by Carnuke on 2004/12/20 20:21:33

How can I control what title tag information is displayed for <{$xoops_pagetitle}> in the header.php?

XoopsTpl API Docs The default theme (and most other themes) has this line in the theme smarty file (theme.html)

<title><{$xoops_sitename}> - <{$xoops_pagetitle}></title>
Which tells the Smarty Template Engine to take the assigned values for xoops_sitename and xoops_pagetitle and add them in the title. "Where do those values get filled?" you may ask. The answer is they are filled in header.php:
$xoopsTpl->assign('xoops_pagetitle'$xoopsModule->getVar('name'));
Before you run off to header.php to mess with these lines, let me ask a question. What information are you wanting to put in the page title? If it is an article, you probably want to put the article title up there, if it is a forum post, you probably want the name of the thread up there. If this is the case, the proper way to deal with this problem is to add a line in the module page you want to modify:
$xoopsTpl->assign('xoops_pagetitle''Your Page Title');
You'll find that XOOPS gives full control over the title tag (being that it is a variable that an application can modify), but the modules themselves need to assign relevant information to the template.

This Q&A was found on XOOPS Web Application System : https://xoops.org/modules/smartfaq/faq.php?faqid=325