Author Topic: Categories list on other files  (Read 2226 times)

0 Members and 1 Guest are viewing this topic.

Offline eluis

  • Pre-Newbie
  • Posts: 9
    • View Profile
Categories list on other files
« on: October 18, 2011, 11:19:58 PM »
Hi,

I'm modifying a template and I would like to put the categories list on the footer page.
On the index.php it appears...

On details and categories file the "categories list" does not appear..

Template home.html bottom line:
{footer}
It's ok...

Template details.html bottom line:
{footer}
does not appear nothing, only "hr" line.

Template footer.html:
<hr size="1">
{categories}
</body>
</html>


It sounds that {categories} function can't be called from another file unless is home.html


------------------------------ UPADATE


Ok, I got it...

I just add the following code to the PHP files where I need, in this case: details.php file.

//-----------------------------------------------------
//--- Show Categories ---------------------------------
//-----------------------------------------------------
$categories = get_categories(0);
if (!$categories)  {
  $categories = $lang['no_categories'];
}
$site_template->register_vars("categories", $categories);
unset($categories);
//------------------------------------------------------

« Last Edit: October 18, 2011, 11:30:31 PM by eluis »