Child Categories
ExpressionEngine 1.x, ExpressionEngine 2
Back to this add-on's main page
View Other Add-ons From Laisvunas
Limit child categories with category segment_id?
Support Request
Chris Arnold
|
Posted: 22 August 2014 03:53 PM |
|
|
|
Hello. I currently use Child Categories to output the entire list of children based on segment_2, but my client has now requested specific landing screens for each child. In other words /products/category/sub-category needs to display only that of the sub-category entries. I didn’t notice a way to limit the loop to a specific sub-category. Here is my current code for the /products/category page that lists out each child in a loop.
{exp:child_categories parent="{segment_2_category_id}" child_categories_sort_by="custom" child_categories_sort_direction="asc" entries_limit="none" parse="inward" status="open"}
{child_category_start}
<div class="grid_12 alpha omega product-icon-wrap margtop">
{child_category_end}
{entries_wrapper_top_start} <!-- product icons wrapper --> <div class="grid_12 alpha omega margtop"> {entries_wrapper_top_end}
{entries_start}
{!-- use field value to pull custom image field --} {exp:field_value entry_id="{entry_id}" site="1"} <!-- product icon --> <div class="grid_3 product-icon"> {!-- pull in product icon image --} <img src="{field_value_product-icon}" height="150" width="150" alt="" title="{field_value_product-display}" /> <span><a href="/{segment_1}/{segment_2}/{url_title}/">{field_value_product-display}</a></span> {!-- check availability --} {if field_value_product-availability} <span class="unavailable-medium">{field_value_product-availability}</span> {/if} </div> {/exp:field_value}
{entries_end}
{entries_wrapper_bottom_start} </div><!-- x grid_12 --> </div><!-- x grid_12 --> {entries_wrapper_bottom_end}
{/exp:child_categories}
|
|
|
Chris Arnold
|
Posted: 27 August 2014 06:48 PM |
# 1
|
|
|
Hi there, following up on my question. Thanks!
|
|
|
Chris Arnold
|
Posted: 03 September 2014 05:46 PM |
# 2
|
|
|
Following up again here. Pinged you on Twitter last week as well. Any word on my query? Thank you.
|
|
|
Laisvunas
|
Posted: 06 September 2014 03:19 PM |
# 3
|
|
Developer
|
Hi,
The aim of this plugin is to loop through child categories and their entries. It would be inefficient to use it too display entries of certain category.
Why do you not consider the usual approach: exp:channel:entries or exp:channel:category_archive tag?
|
|
|
Chris Arnold
|
Posted: 07 September 2014 06:16 PM |
# 4
|
|
|
I’m precisely doing just that, but the client wants to limit those categories/entries to something specific as I noted above, without rewriting a new template. Is this possible?
|
|
|