1
biglove
What file contains $xoopsTpl class?
  • 2004/10/27 22:39

  • biglove

  • Not too shy to talk

  • Posts: 157

  • Since: 2004/8/18


I'm trying to create a hack to help out XOOPS for SEO.

We need better control of the TITLE tags.

Title is very important for search engines to be able to identify the relevance of the information on the page.

Thanks

2
ackbarr
Re:What file contains $xoopsTpl class?

XoopsTpl API Docs

However based on the rest of your statement it is important for you to know that the XoopsTpl object does not control the page title (not really anyway)

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.

3
biglove
What I would like to do
  • 2004/10/28 16:33

  • biglove

  • Not too shy to talk

  • Posts: 157

  • Since: 2004/8/18


Thanks for your detailed response.

What I am trying to do is as follows:

//if module is newbb then set title as
<title><{$topic_title}> - <{$xoops_pagetitle}></title>

I would also like to test having just the Topic title displayed.

//if module is newbb then set title as
<title><{$topic_title}></title>

I'm uncertain which of those 2 the search engines will like the best.

So would a change like this be best to perform in the newbb module itself? ( i.e. viewtopic.php )

Also, it would seem to get the results that I want, I might need to clear the $xoops_pagetitle because it appears that method concatenates to the existing string.



___________________________________________

I actually looked at the XoopsAPI. I'm new to the concept of OOP and do not quite understand how to use API documents. Is there a way to search the API document for class. I was looking in every section that seemed to apply.

Maybe a google site: search would do the trick.

4
bjbtexas
Re:What file contains $xoopsTpl class?
  • 2004/12/20 18:10

  • bjbtexas

  • Not too shy to talk

  • Posts: 106

  • Since: 2004/7/3 2


If this is where the title is changed in newbb 2.0 for the viewtopic.php page:

if(newbb_isAdmin($forumdata['forum_id'], $forumdata['topic_poster']) && $xoopsModuleConfig['allow_moderator_html'] ) $topic_title newbb_html2text($myts->undoHtmlSpecialChars($forumdata['topic_title']));
else 
$topic_title $myts->htmlSpecialChars($forumdata['topic_title']);
$forum_name newbb_html2text($myts->undoHtmlSpecialChars($forumdata['forum_name']));
$module_name $xoopsModule->getVar('name');
$xoops_pagetitle $module_name' - ' .$forum_name' - ' .$topic_title;


include 
XOOPS_ROOT_PATH."/header.php";
$xoopsTpl->assign('xoops_module_header'$newbb_module_header);
$xoopsTpl->assign('xoops_pagetitle'$xoops_pagetitle);$xoops_pagetitle $module_name' - ' .$myts->displayTarea($forum_name). ' - ' .$topic_title;


Can you offer any advice as to how to change it in xDirectory?

Thanks,

Login

Who's Online

205 user(s) are online (126 user(s) are browsing Support Forums)


Members: 0


Guests: 205


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits