I’m concerned I am over engineering this as a result of overlooking something small and hope someone can point me in the right direction.
BRIEF:
I have a weblog “directory”. It has a category group with Parent categories and Child categories in the format:
Accommodation
- Hotel
- B&B
Eating Out
- Restaurant
- Café
I have a sidebar menu with these parent & child categories listed.
A) If I click on a URL linking to a Child category all the blogs under that child category are displayed correctly. Example URL:
http://www.mywebsite.com/directory/category/hotel/
This is using the standard {weblog:entries} {/exp:weblog:entries} tag pair.
B) If I click on a URL linking to a Parent category I would LIKE all the blogs under any of its Child categories to display … BUT this is not working. Example URL
http://www.mywebsite.com/directory/category/eating-out/
I tried using a combination of tag pairs to get (B) above to work but nothing seems to work. My latest attempt was as per this code below.
{exp:weblog:category_heading weblog="directory"}
{exp:child_categories parent="{category_id}" show_empty="yes"}
{exp:weblog:entries weblog="directory" category="{child_category_start}{child_category_id}|{child_category_end}" orderby="entry_date" sort="desc" limit="5" paginate="bottom"}
{bd_summary}
{paginate}
Page {current_page} of {total_pages} pages {pagination_links}
{/paginate}
{/exp:weblog:entries}
{/exp:child_categories}
{/exp:weblog:category_heading}I did have a LITTLE success with the code above when removing the {weblog:entries} {/exp:weblog:entries} tag pair into a template of its own and then embedding it for each {child_category_id} for example
{exp:weblog:category_heading weblog="directory"}
{exp:child_categories parent="{category_id}" show_empty="yes"}
{child_category_start}
{embed="directory/.dir_list" this_id="{child_category_id}"}
{child_category_end}
{/exp:child_categories}
{/exp:weblog:category_heading}BUT … this does not help with PAGINATION as the {entries} tag is repeated for each {child_category_id} resulting in pagination for each.
Am I over engineering this or is it impossible using standard tags and plugins, forcing me to have to resort to QUERIES and PHP?
Thanks,
Hayden