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.

Sliding Door AJAX Question...

November 05, 2008 6:47pm

Subscribe [2]
  • #1 / Nov 05, 2008 6:47pm

    nullbreached

    116 posts

    I’m trying to build a spry on my website that pulls in different pieces of my portfolio… It’s a three tier AJAX spry that separates vertical pieces from square pieces from horzontal pieces.. I created some unique PHP and but I am getting a lot of repeat pieces… 

    here’s my code:

    <div id="slidingPanel_1" class="SlidingPanels-Vertical">
    
                     <div class="SlidingPanelsContentGroup">
    
                    
                <div id="content1" class="SlidingPanelsContent">
                    
                    <ul class="portfolio">
                    {exp:weblog:entries weblog="portfolio" search:thumbnail-proportion="vertical" limit="4"}    
                    
                    <li>
                    <a href="#">{project-image-thumb}<? $entrylist[]= {entry_id};?> </a>
                    </li>
                    {/exp:weblog:entries}
                    </ul>
                
                </div>
                
                <div id="content2" class="SlidingPanelsContent">
                    
                    <ul class="portfolio">
                    {exp:weblog:entries weblog="portfolio" limit="4" entry_id="not <? echo($entrylist[0]);?>|<? echo($entrylist[1]);?>|<? echo($entrylist[2]);?>" search:thumbnail-proportion="vertical" }    
                    <li>
                    <a href="#">{project-image-thumb}<? $entrylist[]= {entry_id};?></a>
                    </li>
                    {/exp:weblog:entries}
                    </ul>
                
                </div>
    
                <div id="content3" class="SlidingPanelsContent">
                    
                    <ul class="portfolio">
                    {exp:weblog:entries weblog="portfolio" search:thumbnail-proportion="vertical"  limit="4"}    
                    <li>
                    <a href="#">{project-image-thumb}<? $entrylist[]= {entry_id};?></a>
                    </li>
                    {/exp:weblog:entries}
                    </ul>

            </div>

    I feel like I am so close… but I just can’t get the pieces to not repeat.. Any ideas?

    FYI.. The code above only represents one tier.. This code repeats for square and horizontal.

  • #2 / Nov 05, 2008 8:08pm

    e-man

    1816 posts

    It’s a three tier AJAX spry that separates vertical pieces from square pieces from horzontal pieces..

    You lost me at Ajax spry… 😊
    But since pieces are repeating have you checked the offset parameter?

  • #3 / Nov 06, 2008 4:28pm

    achilles

    2 posts

    I am working with Studio805 on this problem … in my stubborness I am continuing to forge ahead. I would work with the Offset parameter but I was hoping things would be a bit more random than that. I am a total EE newbie (php as well) actually to be honest I’m new to web site development in general.

    I guess the problem lies in how and when the different elements of EE and php are processed. To restate the issue —  I need to generate content (thumbnails) for three sequential DIVs(Content1,2,3) for use in a AJAX-style sliding panel. Each DIV is one of the panels. Ideally, I had hoped to randomly display the thumbnails. So on subsequent visits the thumbnails would appear differently. As an EE newbie I approached the problem by doing a exp:weblog:entries while keeping track of the entry_id’s. In the next DIV I would entry_id=“Not” those tracked entry_id’s. Essentially revealing new content by the process of elimination. Something like this:

    <div id="content1" class="SlidingPanelsContent">
                    
                    <ul class="portfolio">
                    {exp:weblog:entries weblog="portfolio" search:thumbnail-proportion="vertical" dynamic="off" limit="2" orderby="random"}    
                    
                    <li class="service-description"> <a href="#">{project-image-thumb}<?php $entrylist[]= {entry_id}; ?></a> </li>
                    
                    {/exp:weblog:entries}
                    
                    {assign_variable:exclude="<?php acho "not ".implode("|",$entrylist); ?>"}
                    
                    </ul>
                </div>
            
                <div id="content2" class="SlidingPanelsContent">
                    
                    <ul class="portfolio">
                    {exp:weblog:entries weblog="portfolio" search:thumbnail-proportion="vertical" dynamic="off" limit="2" orderby="random" entry_id="<?php echo "not ".implode("|",$entrylist); ?>"}
                         
                    <li class="service-description"> <a href="#">{project-image-thumb}<?php $entrylist[]= {entry_id}; ?></a>    </li>
                    
                    {/exp:weblog:entries}
                    </ul>
    
                </div>
        
                <div id="content3" class="SlidingPanelsContent">
                    
                    <ul class="portfolio">
                    {exp:weblog:entries weblog="portfolio" search:thumbnail-proportion="vertical" dynamic="off" limit="3" orderby="random" entry_id="<?php echo "not ".implode("|",$entrylist); ?>"}
                    
                    <li class="service-description"> <a href="#">{project-image-thumb}</a> </li>
                    
                    {/exp:weblog:entries}
                    </ul>
                
                </div>

    Although I can php echo out the results — and they seem correct — the values don’t seem to work in the entry_id parameter.

    The only way I have gotten things to work is by nesting embedded templates and passing along some variables for each DIV. But the end result seems very inelegant and less flexible.

    Because of my inexperience,  I really doubt this will make sense to anyone but I guess it won’t hurt too much to try.

  • #4 / Nov 06, 2008 5:06pm

    e-man

    1816 posts

    I believe you’re running into a parsing order problem. Since basically you need 6 random entries you might want to try a custom query, load them in an array and then echo out the entry_id’s in your template? Just brainstorming here…

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

ExpressionEngine News!

#eecms, #events, #releases