Turn on/off view Items in Category View

More
11 years 5 months ago #30298 by iamrobert
Sometimes - clients just want to show the category description - and not show the items at all. My way of doing this is.

1. Open up your template folder
2. In category.xml add:
Code:
<field name="show_items" type="list" default="1" label="Show Items" description="Display Items on Category Page"> <option value="0">FLEXI_NO</option> <option value="1">FLEXI_YES</option> </field>

3. In category.php, change:
Code:
<!-- Start item list display --> <?php echo $this->loadTemplate('items'); ?> <!-- Start item list display -->

To:
Code:
<!-- Start item list display --> <?php if ($this->params->get('show_items', 1)) : ?> <?php echo $this->loadTemplate('items'); ?> <?php endif; ?> <!-- Start item list display -->

Please Log in or Create an account to join the conversation.

More
11 years 5 months ago #30299 by ggppdk
In RC7+ you can use the Joomla way , use 0 items per page in category parameters

or

create an new Joomla menu item , pointing to a category and enable override of category parameters and set 0 items per page


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
11 years 4 months ago #31902 by igcorreia
I usually create an item and point to it. What is the difference since the result is the same?

Please Log in or Create an account to join the conversation.

More
11 years 4 months ago #31909 by ggppdk
Joomla behavior for zero "limit" is to show only category information.

which reminds me to add parameters to category view for subcategory image and subcategory descriptions (existing code is finished and ready to use them)


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
11 years 3 months ago #31932 by igcorreia
I see. Thanks for the explanation.

Please Log in or Create an account to join the conversation.

More
11 years 3 months ago #31938 by ggppdk
Also , file:

views/category/view.html.php has FINISHED/TESTED code to create customized subcategory images and descriptions (like in directory view)


I ll copy (a) parameters and (b) layout from directory view (or from FAQ template) to enable this to all templates


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.294 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline