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.

Limiting for channels within bigger group

July 13, 2011 1:34am

Subscribe [1]
  • #1 / Jul 13, 2011 1:34am

    setheryb

    39 posts

    First of let me display the code:

    {exp:channel:entries channel="journal-photo|journal-quote|journal-video|journal-entry|work-branding|work-web|work-video" disable="member_data|pagination|category_fields|categories" limit="8" dynamic="no"}
    {if channel_id == "3"}
    <div class="photo col1 box">{journal-photo-upload}<a href="#"><span><strong>{title}</strong>_photography</span></a></div>
    {if:elseif channel_id == "5"}
    <div class="video col1 box">{journal-video-poster}<a href="#"><span><strong>{title}</strong><br>compositing</span></a></div>
    {if:elseif channel_id == "1"}
    <div class="blog col1 box">
            <h3>{title}</h3>
    <p>        {journal-entry-summary}<br />
            {entry_date format="%F %j, %Y"} | <a href="/blog/{url_title}/">Full Post</a><br />
        </div><br />
    {if:elseif channel_id == "4"}<br />
    <div class="quote col1 box">{journal-quote} <span>-{journal-quote-source}</span><br class="clearfix"></div><br />
    {if:elseif channel_id == "8"}<br />
    <div class="brand col2 box">{work-brand-image}<a href="#"><span><strong>{title}</strong><br>design</span></a></div><br />
    {if:elseif channel_id == "6"}<br />
    <div class="web col2 box">{work-web-image}<a href="#"><span><strong>{title}</strong><br>design</span></a></div><br />
    {if:elseif channel_id == "7"}<br />
    <div class="video col2 box">{work-video-poster-frame}<a href="#"><span><strong>{title}</strong><br>compositing</span></a></div><br />
    {/if}</p>
    
    <p>{/exp:channel:entries}


    I have these different channels that I’m combining into one on the home page. Each channel is being displayed differently via the if:else statements. What I’d like to do is limit the total number of entries to 10. But I’d also like to limit the number of entries that the channels can display individually as well. I just can’t figure out how this would be done.

    So to reiterate, I have multiple channels combining into one with a group limit of 10. I’d like to apply limits to how many each channel displays within the group.

    Sharing of your knowledge would be greatly appreciated.

  • #2 / Jul 13, 2011 10:51am

    First, on the face of it, it seems like you could drastically reduce the number of channels you’re dealing with by using a few categories, and that could make your presentation and long-term maintainability a heck of a lot easier.

    Any solution I’d be able to come up with for this would involve a lot of PHP in your template, and I’m not sure that’s the best way of accomplishing it.

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

ExpressionEngine News!

#eecms, #events, #releases