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.

In Need of Weblog Formatting Assistance

April 26, 2011 2:53pm

Subscribe [2]
  • #1 / Apr 26, 2011 2:53pm

    Hey everyone. I’ve been developing on EE for quite some time but ran into a little issue with the formatting of a weblog for a jquery slider element. I was hoping to gain some suggestions from the community on a proper solution.

    The Slider Element

    <div id="slider">
                /path/to/image.jpg
                /path/to/image.jpg
                /path/to/image.jpg
                /path/to/image.jpg
            </div>
            <div id="caption-holder">
                <div id="caption1">
                    <h2>Caption 1
     some text here</h2>
    <p>            </div><br />
                <div id="caption2"><br />
                    </p><h2>Caption 2
     some text here</h2>
    <p>            </div><br />
                <div id="caption3"><br />
                    </p><h2>Caption 3
     some text here</h2>
    <p>            </div><br />
                <div id="caption4"><br />
                    </p><h2>Caption 4
     some text here</h2>
    <p>            </div><br />
            </div>

    Normally I’d set something like this…

    {exp:weblog:entries weblog="slider"}
    <div id="slider">
                {slider_image} alt=
            </div>
            <div id="caption-holder">
                <div id="caption1">
                    <h2>{slider_text}</h2>
    <p>            </div><br />
            </div><br />
    {/exp:weblog:entries}

    I have setup a field group called “sliders” with two fields “slider_image” and “slider_text”.

    My problem:

    The second caption-holder div has me for a loss. I cannot figure out a method to be able to display the fields in the weblog because of the unique caption id tags.

    I thought about setting up two weblogs, one for the image and the other for the text via a relationship between the two but cannot get it to work.

    Any ideas?  Surely I am over complicating this.

    Any suggestions?

  • #2 / Apr 27, 2011 6:18am

    John Henry Donovan

    12339 posts

    wwobn,

    How about something like this

    <div id="slider">
    {exp:weblog:entries weblog="slider" dynamic="off"}
                {slider_image} alt=
    {/exp:weblog:entries}
            </div>
            <div id="caption-holder">
    {exp:weblog:entries weblog="slider" dynamic="off"}
                <div id="caption{count}">
                    <h2>{slider_text}</h2>
    <p>            </div><br />
    {/exp:weblog:entries}<br />
            </div>

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

ExpressionEngine News!

#eecms, #events, #releases