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.

Showing prev next links even with no next/prev post available

September 15, 2009 10:09pm

Subscribe [2]
  • #1 / Sep 15, 2009 10:09pm

    jbcobbs

    53 posts

    I am creating a gallery where you can click the image and it will go to the next image, like facebook. I wrapped the prev_entry code around the image and that works great with one problem. The last image is hidden due to the behavior of the prev_entry code that hides the link if there is no more entries. Any way around this?

    {exp:weblog:entries weblog="photo_gallery" orderby="date" sort="asc" category="22"} 
    {exp:weblog:prev_entry category="{categories}{category_id}{/categories}"}
    <a href="http://{path=gallery/details}">/phpThumb/phpThumb.php?src={photo_image}&w=980&aoe=1&hp=650</a>
    </div>
    <div id="element_info">
    <li><h1>{title}</h1></li>
    <li>{photo_description}</li>
    </div>
    {/exp:weblog:prev_entry}
    {/exp:weblog:entries}
  • #2 / Sep 16, 2009 2:00am

    John Henry Donovan

    12339 posts

    jbcobbs,

    I have moved this thread to the “How to” forum as it is more appropriate there.

    Those tags are not intended to be nested.

    What I would do is find a JavaScript gallery that does what you want it to do then use their example template and build EE’s tags into it. Maybe something like the jCycle plugin

  • #3 / Sep 16, 2009 10:09am

    jbcobbs

    53 posts

    They are not supposed to be nested? Then how are they supposed to be used. Im a little confused. Do you mean my code should be like below? Problem is if I do that, my custom fields dont work. Are they not supported?

    {exp:weblog:prev_entry category="{categories}{category_id}{/categories}"}
    <a href="http://{path=gallery/details}">/phpThumb/phpThumb.php?src={photo_image}&w=980&aoe=1&hp=650</a>
    </div>
    <div id="element_info">
    <li><h1>{title}</h1></li>
    <li>{photo_description}</li>
    </div>
    {/exp:weblog:prev_entry}
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases