ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Building Links With Category Entries and Many Different Templates

August 26, 2012 10:27am

Subscribe [2]
  • #1 / Aug 26, 2012 10:27am

    wireframe

    24 posts

    I am assisting a developer in building a site which has a huge amount of categories and around 10+ templates.

    Here is a link. http://genesiscare.ctcdev.net/

    At the moment I think the developer has got some code that is quite complicated (which is a little un EE like) that generates the list of links in superfish dd menu.

    His code for menu looks like this:

    <li class="nav-spacer"></li><li class='{embed:host_language_channel_name}'>{exp:query sql="SELECT cat_id, exp_categories.site_id, group_id, cat_url_title, channel_name FROM exp_categories INNER JOIN exp_channels WHERE exp_categories.site_id = '{site_id}' AND (cat_group = group_id AND channel_name = '{embed:host_language_channel_name}') AND (cat_url_title = '{embed:host_language_channel_name}')" cache='yes' refresh='10080'}<a href="http://{global_url}{global_state_url}{embed:{embed:language}_channel_name}/" class="selected">{embed:{embed:language}_full_channel_name}</a>{if no_results}<a{if embed:host_language_channel_name == '{segment_1}'} class="selected"{/if}>{embed:{embed:language}_full_channel_name}</a>{/if}{/exp:query}{!-- MENUS ul begins here--}{exp:channel:categories site='{embed:site}' channel='{embed:host_language_channel_name}' show='not {embed:nav_landing_id}10000' id='{embed:host_language_channel_name}-sf-menu' class='dd' show_empty='no' parent_only='no' cache='yes' refresh='10080'}<a href="http://{global_url}{global_state_url}{embed:{embed:language}_channel_name}/{category_url_title}/">{category_name}</a>{/exp:channel:categories}</li>

    I am thinking is it better to just simply build a few different exp:channel:categories loops for each different channel and then link them to different templates that will be hard coded into the {path}variable?

    Or would it be better to use the Page URI for this and to be able to specify a page template on an ad hoc basis whilst setting a default template (with Pages Module) with each channel?

    Advice appreciated

     

  • #2 / Aug 26, 2012 12:22pm

    Enviromed

    375 posts

    It would be wise to also post this on eesitekit.com as the site is written on the eesitekit foundation which includes superfish.  EE sitekit’s intensive templating foundation, designed to avoid PHP, Javascript, jQuery, or third party addons, is what may have made it appear “un-ee-like” at first glance.  If you’re keeping the current site build’s ee sitekit foundation, then your changes need to be consistent with their proprietary ee 2.5.2 version for ease of future ee sitekit version updating.   

    Good luck!   

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases