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.

Make channel entries show up as single slides

November 22, 2012 12:06pm

Subscribe [2]
  • #1 / Nov 22, 2012 12:06pm

    Hi,

    I’m new to EE, and I’m trying to get the hang of it by following a few books on EE 2 😊
    I’m stuck on a issue I can’t seem to solve.

    Would love if someone here could tell me which EE tags I can use.

    I have a slider in the front, which has its own dedicated channel. That channel has four fields: title, image and two text fields.
    What I’m trying to do, is making EE display each entry in this channel, as its own slide on the front.

    Here is my code:

    <div id="main-slider" class="flexslider">
             <ol class="slides">
            <li>
             <article class="kopa-flex clearfix">     
              <a href="http://" class="slide-image">{site_url}images/placeholders/slider/flex-1.jpg</a>
              <div class="f-entry-content">
               {exp:channel:entries channel="frontpage_slider" dynamic="no" limit="3" disable="categories|member_data|category_fields|member_data|pagination"}
               <h3><a href="http://{title_permalink=%22class=%22slide-title%22&gt{title}&lt/a&gt/h3" class="slide-title"><span>Read more</span></a>
              </div><!--f-entry-content-->
             </article>
            </li>

    Problem with this code is that EE adds all entries to the same list element (slide), while I want EE to make a new list element (slide) for each new entry.

    Anyone able to help me out on this one? Also, if anyone spots stuff that could be DRYied more, I would love some feedback on that too. 😊

    Thank you!

    Regards
    Kristoffer

  • #2 / Nov 23, 2012 4:51am

    zizther

    228 posts

    Hi Filadelfia Vennesla and welcome.

    You problem is your not wrapping the channel call around the list elements, so it is outputting all entries within .f-entry-content

    Here is what you want to do:

    {exp:channel:entries channel="frontpage_slider" dynamic="no" limit="3" disable="categories|member_data|category_fields|member_data|pagination"}
        <li>
            <article class="kopa-flex clearfix">     
                <a href="http://" class="slide-image">{site_url}images/placeholders/slider/flex-1.jpg</a>
    
                <div class="f-entry-content">
                    <h3><a href="http://{title_permalink=%22class=%22slide-title%22&gt{title}&lt/a&gt/h3" class="slide-title"><span>Read more</span></a>
                </div><!--f-entry-content-->
            </article>
        </li>
    {/exp:channel:entries}
  • #3 / Nov 23, 2012 5:27am

    Thank you so much! That was too simple! 😊

    I was afraid I had to do some fancy <if something else something> statements. Impressed with the simplicity and power of EE tags. Just gotta know where to put them 😛

    Regards
    Kristoffer

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

ExpressionEngine News!

#eecms, #events, #releases