sub categories on detail page
19 posts by 3 authors in: Forums > CMS Builder
Last Post: March 10, 2009 (RSS)
I have created a category menu with subs, works fine but what I would like to do is find a way to display the sub category links on the detail page of the top level category. I hope this is clear and possible because right now I am sort of hard coding those sub category links through a wysiwyg text box in cmsb(not really be best solution).
Re: [Dan Maitland] sub categories on detail page
By Dave - February 23, 2009
The code generator doesn't create code for category sections yet but you can find an example attached to the first post on this thread:
http://www.interactivetools.com/iforum/P64259
However, if you're only dealing with two or three levels sometimes it's simpler to create 2 or 3 sections instead. What type of content are you working with? Do you have an example url?
interactivetools.com
Re: [Dave] sub categories on detail page
www.eurobloq.com/product-en.php
click on the first link and you will see the sub category links I had to hardcode. you will also see the functioning category menu on the right.
Re: [Dan Maitland] sub categories on detail page
By Dave - February 23, 2009
interactivetools.com
Re: [Dave] sub categories on detail page
Re: [Dan Maitland] sub categories on detail page
By Dave - February 24, 2009
So the first step is getting the record number of the current record. You may have that in a variable such as $record['num'] so you can use that or the following line:
$num = $record['num'];
or
$num = getNumberFromEndOfUrl();
Then generate some list viewer code and add a where of "num = '$num'" like this:
list($categoryRecords, $categoryMetaData) = getRecords(array(
'tableName' => 'category',
'where' => " num = '$num' ",
));
And that will list only the "child" record of the current record.
Hope that makes sense. Let me know if that works for you.
interactivetools.com
Re: [Dave] sub categories on detail page
Also on that same note: Is there a way to display the category menu in my websites second language because right now it is using the english titles and I need to be able to display the french titles for that same menu in the french section?
Re: [Dan Maitland] sub categories on detail page
By Dave - February 26, 2009
list($subCategoryRecords, $categoryMetaData) = getRecords(array(
'tableName' => 'category',
'where' => " num = '$num' ",
));
As for displaying a seperate language. Do you already have fields or records setup with translated content or are you just starting with multi language?
interactivetools.com
Re: [Dave] sub categories on detail page