4images Forum & Community

4images Modifications / Modifikationen => Templates & Styles (Requests & Discussions) => Topic started by: EnglishRider on March 11, 2003, 09:15:07 PM

Title: Categories on every page?
Post by: EnglishRider on March 11, 2003, 09:15:07 PM
Hello,
I am trying to move the categories listing onto the left hand side of the page. This works fine for the first page, but they do not show up. However when I put the random images statement under it, that feature shows up fine on all pages. Am I missing a setting, or does anyone know how to change the code to allow the categories to be shown on all pages? Example here -> http://www.bridlepathdesigns.com/temp/photos/ ... works on that page, but won't show up on http://www.bridlepathdesigns.com/temp/photos/details.php?image_id=8 (excuse the mess, haven't finished editing all the pages). The category statement is in my header file.
Title: Categories on every page?
Post by: V@no on March 12, 2003, 12:31:54 AM
in the main .php files witch u are having problem with (such as details.php, member.php, lightbox.php and so on) at the end find:
Code: [Select]
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------

add before:
Code: [Select]
$categories = get_categories(0);
if (!$categories)  {
  $categories = $lang['no_categories'];
}
$site_template->register_vars("categories", $categories);
unset($categories);
Title: Categories on every page?
Post by: EnglishRider on March 12, 2003, 03:55:05 PM
Perfect, thank you!
- Carole
Title: Categories on every page?
Post by: matlex on April 04, 2003, 05:05:28 PM
Quote from: V@no
in the main .php files witch u are having problem with (such as details.php, member.php, lightbox.php and so on) at the end find:
Code: [Select]
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------

add before:
Code: [Select]
$categories = get_categories(0);
if (!$categories)  {
  $categories = $lang['no_categories'];
}
$site_template->register_vars("categories", $categories);
unset($categories);


By reading post
http://4homepages.de/forum/viewtopic.php?t=4582


I have tried and its working great on all pages apart of categories.php
When I put it everything get mixedup... like
{cat_name} will show same name for every category
{cat_description} same as above
Subcategory doesn't show at all instead show up again main categories

Is it any solution can be found?
Please help

Thank you
Matlex
Title: Categories on every page?
Post by: speedway on April 29, 2003, 04:36:41 PM
Quote from: matlex

By reading post
http://4homepages.de/forum/viewtopic.php?t=4582


I have tried and its working great on all pages apart of categories.php
When I put it everything get mixedup... like
{cat_name} will show same name for every category
{cat_description} same as above
Subcategory doesn't show at all instead show up again main categories

Is it any solution can be found?
Please help

Thank you
Matlex


Matlex

I have used this in categories.php:

Code: [Select]

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

basically I just "renamed" anything with "categories" to "main_categories" and placed {main_categories} in the template where I wanted it - works great AND still gives you any subcats....

Cheers
Title: Re: Categories on every page?
Post by: eshpro on October 04, 2005, 08:41:25 PM
What??? nothing needs to be fixed.. i just want to add my category list on every page.. like details.php but it doesn't work .. :/
Title: Re: Categories on every page?
Post by: animal lover on May 25, 2009, 05:21:50 PM
I know this is an old thread but I have this problem.  I have changed all the .php pages as directed above and they work great, however, there is a problem with the category.php page as explained above.  This below does not work. 
Quote
Matlex

I have used this in categories.php:

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

basically I just "renamed" anything with "categories" to "main_categories" and placed {main_categories} in the template where I wanted it - works great AND still gives you any subcats....

Cheers


Unless I am missing something.  Does anyone know how to change the categories.php page to show the categories and with the category links working correctly.  Thanks
Title: Re: Categories on every page?
Post by: animal lover on May 25, 2009, 05:33:49 PM
Okay okay.  I found it.  I didnt think I would get a reply on an old thread like this so I refined my search phrase and I found this which works perfectly

http://www.4homepages.de/forum/index.php?topic=23516.0

Just to clarify - you need to change your categories.html (or any other template) to  categories_all 

Thanks very much.
Title: Re: Categories on every page?
Post by: croking on March 02, 2010, 12:13:27 PM
hi v@no,

works fine but i have one problem with this mod.

on categories and details the {cat_name} is always just the last category
from my category list.
example: i have three categories:
the {cat_name} shows always category3 on categories and details pages

can you help me?

CroKing