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.

Year Archive with Accordion

November 26, 2012 4:35pm

Subscribe [2]
  • #1 / Nov 26, 2012 4:35pm

    defreeze

    37 posts

    This is a re-posting of a thread that I haven’t managed to resolve as yet:
    http://ellislab.com/forums/viewthread/229641/

    I’m struggling to get Expression Engine to spit out the code to make an accordion function properly.

    Shane Eckert was offering great assistance and his last suggestion (found below) can be found here:
    http://www.marymarygallery.co.uk/dev2012/index.php/programme/archive

    <div id="accordion">
    <dl class="accordion" id="slider">
    {exp:channel:entries channel="programme" orderby="date" sort="desc"}
    {date_heading display="yearly"}
    <dt class="yearunderline">{entry_date format="%Y"}</dt>
    {/date_heading}
    {if count == 1}<dd>{/if}
    <a href="http://path">{title}</a>
    
    {if count == total_results}</dd>{/if}
    {/exp:channel:entries}
    </div>

    This code only spits out one set of < dd> </ dd> tags.

    I need the < dd> </ dd> tag to wrap around each set of link for a given year.

    ie.

    Year Title

    DD Wrap
    set of links here
    Close DD Wrap

    Next Year Title

    DD Wrap
    set of links here
    Close DD Wrap

    etc.

  • #2 / Nov 26, 2012 4:52pm

    e-man

    1816 posts

    Have you looked at http://gotolow.com/addons/low-yearly-archives ? Might get you closer to what you need.

  • #3 / Nov 26, 2012 5:13pm

    defreeze

    37 posts

    I’ll check it out - thanks!

  • #4 / Dec 11, 2012 8:50am

    defreeze

    37 posts

    Hi guys,
    Nope The Low Yearly Archive can not list the entry titles of a given year - it just does the months…. Any other ideas - I’m happy to pay for some assistance!
    Thanks
    Patricia

  • #5 / Dec 11, 2012 9:21am

    e-man

    1816 posts

    This should do the trick:

    <div id="accordion">
    <dl class="accordion" id="slider">
    {exp:channel:entries channel="programme" orderby="date" sort="desc"}
      {date_heading display="yearly"}
       <dt class="yearunderline">{entry_date format="%Y"}</dt>
      {/date_heading}
    
      {date_heading display="yearly"}<dd>{/date_heading}
        <a href="http://path">{title}</a>
       {date_footer display="yearly"}</dd>{/date_footer}
    
    {/exp:channel:entries}
    </div>
  • #6 / Dec 11, 2012 9:39am

    defreeze

    37 posts

    AMAZING!!

    That has done the trick perfectly

    Thank you very much!

  • #7 / Dec 11, 2012 9:48am

    e-man

    1816 posts

  • #8 / Dec 11, 2012 9:50am

    defreeze

    37 posts

    That’s brilliant - I never knew about them!
    Thank you!

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

ExpressionEngine News!

#eecms, #events, #releases