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.

Logic, variables and double entry rendering

September 13, 2009 7:22am

Subscribe [3]
  • #1 / Sep 13, 2009 7:22am

    trixpan

    9 posts

    Hi there,

    The following is a piece of a template test I’m currently try to work out. CSS/HTML wise the layout produces a javascript tabbed display. However after managing to get it working I’m trying to go a little bit further, adding some randomness to the rendering.

    <div id="TabbedPanels1" class="TabbedPanels">
            <div class="TabbedPanelsContentGroup">
      {exp:weblog:entries status="open" orderby="random" limit="4" } 
                <div class="TabbedPanelsContent">
          {summary}<a href="http://{comment_url_title_auto_path}">more</a></div>
          {/exp:weblog:entries} 
            </div>
    
            <ul class="TabbedPanelsTabGroup">     
      {exp:weblog:entries status="open" orderby="random" limit="4" } 
              <li class="TabbedPanelsTab" tabindex="0">{weblog}</li>
          {/exp:weblog:entries} 
            </ul>
          </div>

    As you noticed, in this broken scenario both sections are using orderby=“random”, therefore the li items will almost certainly render the {weblog} value from a different entry.

    Is there any way of making this work? Is PHP the only way to go?

    Best regards

  • #2 / Sep 13, 2009 10:40am

    Derek Jones

    7561 posts

    You could use PHP on output, to gather the associated weblogs for each displayed item, and then loop through that later in the template, or you could build it all within one weblog entries tag, and move the second unordered list to a different spot in the markup with the Reeposition plugin.

  • #3 / Sep 14, 2009 10:33am

    trixpan

    9 posts

    Tks Derek,

    You are the guy! 😊

  • #4 / Sep 14, 2009 10:34am

    Sue Crocker

    26054 posts

    Glad Derek was able to help. Don’t hesitate to post again as needed.

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

ExpressionEngine News!

#eecms, #events, #releases