Vivvo CMS Support Forum Home | Free Trial | Online Demo | Docs and Manuals | Order Now   

Go Back   Vivvo CMS Support Forums > Vivvo 3 > Code Customizations & Templates for 3.x Branch

Code Customizations & Templates for 3.x Branch Various code hacks and customizations for Vivvo 3.x branch. Note that 3.x branch is NOT supported anymore.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 03-19-2006, 11:09 AM   #1
boccio
Managing Director
 
boccio's Avatar
 
Join Date: Sep 2005
Age: 37
Posts: 1,922
Rep Power: 10
boccio has disabled reputation
Default Mod: Display subcategories on Category page

Here is a little hack to display subcategories in main category view. If you have a lot of subcategories, you probably won't display them in main navigation to keep the nav clear, so this can come very useful.

1. category_Main.tpl
Place the {SHOW_SUBCATEGORIES} tag somewhere inside the template, where you want subcategories shown. Preferebly at the top of the file, above or below the {CATEGORY_NAME} tag. Format the output at will.
Code:
<tr>
     <td colspan="2"><br />{SHOW_SUBCATEGORIES}</td>
</tr>
2. index.php:
Place the call to function that parses the new tag in template. Preferably somewhere around line 286:
Code:
$show_subcategories_HTML = HTML_show_subcategories($cid);
Also, around line 792, (at the bottom of the section after ''/{SITEMAP_LINK}/'') place this line:
Code:
'/{SHOW_SUBCATEGORIES}/',
and after line 836 (exactly after $sitemap_link,):
Code:
$show_subcategories_HTML,
3. HTML_function.php:
After line 161 (approx.) place the function to manage the display:
Code:
function HTML_show_subcategories($cid, $prf='')
{
            global $url, $tpl_folder,$lang, $connection, $category;

            $query = "SELECT id FROM tblCategories WHERE parent_cat=$cid ORDER BY order_num";
            $result2 = mysql_query($query) or sql_error ($query, "show_subcategories");

            $sub_category_menu = "";

            while($row2=mysql_fetch_array($result2))
            {
                        $sub_category = new Category();
                   $sub_category->LoadFromDatebase($connection,$row2['id']);
                        $sub_category_menu.= "<div class=\"category_link_depth2\"><a href=\"".HTML_show_friendly_cat($sub_category->Id)."\">";
                        $sub_category_menu.= $prf.$sub_category->Category_name."</a></div>";
                        $cid = $sub_category->Id;
                        $sub_category_menu.= HTML_show_subcategories($cid, $prf.'- ');
            }

            return $sub_category_menu;
}
__________________

[ BorisKrstovic.com ]
[ Vivvo | Twitter ]

Mile voli disko, a ja belo kolumbijsko

Last edited by boccio; 05-01-2006 at 11:43 AM.
boccio is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Order now:

Order your copy of Vivvo now and get:
bullet Six months free upgrades
bullet Free support
bullet Full source code
bullet Immediate download
bullet Starting at only $295.00
Order now

Support HelpDesk:

You can submit a trouble ticket in the support area at any time, using your client area email and password.

Vivvo CMS Resource Center:

The Vivvo CMS Resource Center is your window to a variety of resources that showcase Vivvo's features and technologies. So whether you're brand new to Vivvo or a seasoned user, you can find the information you need right here!

Latest Additions:

Contact us:

Business hours
Mon-Fri 9:00AM - 6:00PM GMT+1
(Europe)
Telephone Sales
381 11 311-50-20
Email inquiries
sales@vivvo.net
(Sales inquiries)
support@vivvo.net
(Support inquiries)

All times are GMT +1. The time now is 05:23 PM.
Contact Us - Vivvo Home - Archive - Privacy Statement - Top

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.