We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Nested Category Menu + Dynamic Page with Multiple Channels...

Development and Programming

Sunnyland's avatar
Sunnyland
66 posts
about 13 years ago
Sunnyland's avatar Sunnyland

Hi guys,

Sorry this topic is a little in depth as there’s a lot of factors working together to get it happening, and it’s a work in progress, so it’s not all pretty and finished up yet, but basically:

I’m having trouble with the nested category list, which should be creating pages dynamically based on entries from a particular channel’s assigned category list. (I’m creating a print_solutions menu where all kinds of products will be added into various categories, and you can click a category to find the products with text info and a gallery).

Here’s the site I’m developing… http://projects.sunnylandpress.com.au

I should mention that everything works fine when I create the pages statically (as below) but I will need to create these pages dynamically based on categories (1. because there’s so many, and 2. because they will change and be added to.).

I am selectively reading in content from a couple of channels as follows: promotion_top (the promo in the header at the top), top_banner (the scrolling banner appearing on some pages), page_content (only to be used as page content for main site pages with their own templates, i.e. home, about us, contact etc.).

I’ve created a static page (new template) for an entry to show what the print_solutions pages should look like: http://projects.sunnylandpress.com.au/index.php/wedding_invitations

The nested category menu on the left is simply created using the suggested:

{exp:channel:categories channel="print_solutions" style="nested"}
   <a href="http://{path=SITE_INDEX}">{category_name}</a>
{/exp:channel:categories}

And displaying it as a jquery accordion tabs menu, using:

$('.nav_categories').dcAccordion({eventType: 'click',autoClose: true,saveState: true,disableLink: true,showCount: true,speed: 'slow'});
[script type='text/javascript' src='http://www.designchemical.com/lab/wp-content/themes/dclab/js/jquery.cookie.js'][/script]
[script type='text/javascript' src='http://www.designchemical.com/lab/wp-content/themes/dclab/js/jquery.hoverIntent.minified.js'][/script]
[script type='text/javascript' src='http://www.designchemical.com/lab/wp-content/themes/dclab/js/jquery.dcjqaccordion.2.6.min.js'][/script]

In the dynamic pages created from the print_solutions menu on the left, I will need to display the previously mentioned channels, most importantly the content from the linked entry in the print_solutions channel (assigned to the print_solutions categories used in the menu), and finally a gallery channel displaying images and captions in an image scroller (where one is assigned to a particular category from the print_solutions channel).

For now I’ve only created an entry in one of the categories from the print_solutions menu on the left, being: http://projects.sunnylandpress.com.au/index.php/category/wedding_invitations

Now it SEEMS that the method mentioned above for creating the nested category menu links to a template location like site_path/category/category_name So I created a template group called category and copied the main template (index from my pages template group) into this location, and changed it to read entries from the print_solutions channel as intended.

{exp:channel:entries channel="print_solutions"}
    fields that i want to read in 
{/exp:channel:entries}

It seems that this will show all entries from all print_solutions categories, so I tried running a filter like this:

{exp:channel:entries channel="print_solutions"}
   {if url_title==url_segment_2}
       fields that i want to read in 
   {/if}
{/exp:channel:entries}

Which seems to work fine.

Although it seems to only read in the actual print_solutions channel, and not the other channels assigned to the page, like the gallery channel and the promotion_top channel etc, as it needs to.

Interestingly, on an empty category link (non-parent) it displays the other channels correctly (including the missing gallery, which I will filter properly to the appropriate category/entry once I get it working.)

I NEED TO KNOW HOW TO SET UP THE NESTED CATEGORY LIST AND RESULTING DYNAMIC TEMPLATE CORRECTLY SO THAT ALL ASSIGNED CHANNELS PULL ENTRIES AND DISPLAY AND FILTER CORRECTLY.

If anyone could help me with this I would be soooo happy to get this vital site function working.

Best Regards,

Jonathan Graphic Design / Web Development Sunnyland Press

       
Sunnyland's avatar
Sunnyland
66 posts
about 13 years ago
Sunnyland's avatar Sunnyland

Alright,

for the record,

after trying about every other thing I could think of…

I changed the path for the nested category links to a set location rather than site_index (where pages is the template group I’m using) like so:

{exp:channel:categories channel="print_solutions" style="nested" show_empty="no"}
      <a href="http://{path=pages/index/print_solutions}">{category_name}</a>
     {/exp:channel:categories}

And copied the index template to a new template called print_solutions in the same template group, where I filter the entries like this:

{exp:channel:entries channel="print_solutions" sort="asc" category_url_title="segment_4"}
     stuff I want to call
    {/exp:channel:entries}
^ Text entries for each category assigned here
{exp:channel:entries channel="gallery" sort="asc" category_url_title="segment_4"}
     stuff I want to call
    {/exp:channel:entries}
^ Image entries for each category assigned here

And finally both the text and the image entries appear on the page together, both assinged the same category group of ‘print_solutions; and are filtered by which category/ies they are assigned to within that group.

Although oddly the promotion_top channel entry from the top disappears on this page…

I’m not sure why that’s disappearing, but I did achieve my main objective, so that’s a relief.

If anyone can figure out why I’m getting issues with some of the channels not displaying properly on the new template (which is essentially exactly the same as the others), as reached via the nested category menu, I’d be interested to hear.

Cheers.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.