Categories in vertical menu

Core code customizations and Smarty markup and Template design help in regards to ADP.

Moderator: pgolovko

Categories in vertical menu

Postby Szise » 02/22/2009 1:38 am

Hello all, i want to display the categories in a vertical menu, from the examples posted here i saw is possible using :

Code: Select all
{foreach from=$categories name=categories item=cat key=cats}
<li><a href="{$cat.path}/">{$cat.title}</a></li>
{/foreach}


The categories are displayed in a verical menu but i plan not use subcategories so i'm interested to show all the categories with the correct path on all my pages.

Currently with the expression posted above the categories are displayed only on my main page, when i click any category only "home" and "add url" links are displayed, to go to another category i must click "home" and only after choose a new category.

Also with the above page on my "addurl" page is displayed a small arrow.

Examples :

Main main page :

Menu

* Home
* Submit
* Category 1
* Category 2

The Categories :

Menu

* Home
* Submit

Add URL Page :

Menu

* Home
* Submit
* <


How i want ?

Menu

* Home
* Submit
* Category 1
* Category 2

On all my pages not only on my main page and the path to be correct, if i browse "Category 2" and click "Category 1" to go to /category1/ not /category2/category1/

Any sugestions are appreciated :salute:
Szise
 
Posts: 11
Joined: 02/22/2009 1:18 am


Postby Szise » 02/22/2009 2:18 am

Update :

Used this code i found on this forum but the path is incorrect when i browse one of the categories, example when i browse /category 1 and click "Category 2" i'm redirected to : category1/category2/ instead of /category2

Code: Select all
{php}
$result = mysql_query("SELECT * FROM `categories` ORDER BY `title` ASC");
echo mysql_error();
while($row = mysql_fetch_array($result)){
   ?>
   <li><a href="<?=$row['path']?>/"><?=$row['title']?></a></li>
   <?
   }
{/php}



Another problem, i would like to display the number of categories and number of links on the "addurl" page too and as i said the main menu but is not working for some reason, the codes have no effect on "addurl" page.
Szise
 
Posts: 11
Joined: 02/22/2009 1:18 am

Postby pgolovko » 02/22/2009 8:38 am

__________________
Best regards,
Pavel Golovko
User avatar
pgolovko
 
Posts: 494
Joined: 03/25/2006 1:23 am
Location: Somewhere on planet Earth ....

Postby Szise » 02/22/2009 9:53 am

I'm affraid i'm not able to do this myself, my knowledge is not good in php or smarty. :scratch:
Szise
 
Posts: 11
Joined: 02/22/2009 1:18 am

Postby pgolovko » 02/22/2009 12:54 pm

__________________
Best regards,
Pavel Golovko
User avatar
pgolovko
 
Posts: 494
Joined: 03/25/2006 1:23 am
Location: Somewhere on planet Earth ....

Postby Szise » 02/23/2009 3:01 am

Well i give up, i understand how to create a template for the script, to design it, but don't know how to create such functions, i appreciate your links but i'm not a coder, will be great if you or somebody else can tell me how to do it exactly, the code, function modified :?
Szise
 
Posts: 11
Joined: 02/22/2009 1:18 am



Return to Customization & Templates

Who is online

Users browsing this forum: No registered users and 0 guests

cron