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.

{nth} Plugin Help

January 23, 2011 12:26pm

Subscribe [2]
  • #1 / Jan 23, 2011 12:26pm

    catch

    7 posts

    Hello,

    This is for a simple thumbnail gallery sorted yearly and using the {nth} plugin to get rid of the margin-right on every fourth thumbnail so it aligns properly.

    The problem is I want it to do it only for each year, the way it is now its ignoring the year and continuing to apply it to every forth entry(thumbnail), I understand why its doing it but is there any way or ideas to make it work how I’d like?

    <ul class="artwork">
    {exp:nth class='class="last"' interval="4"}
    {exp:weblog:entries weblog="artwork"}
    
    {date_heading display="yearly"}
        <h2>{entry_date format="%Y"}</h2>
    <p>{/date_heading}<br />
        <li {nth}><br />
            <a href="/artwork/{url_title}">_            {artwork-thumb}_            </p><h3>{title}</h3><p>_        </a><br />
        </li><br />
    {/exp:weblog:entries}    <br />
    {/exp:nth}    <br />
    </ul>

    Thanks for any help!

  • #2 / Jan 23, 2011 7:52pm

    I’ve not used the {nth} plugin but as an alternative to using it you could target the exact element you want with a line of jQuery (before your closing </body> tag) and add a class to it. Same sort of thing really I suppose.

    < script >
    $(".element li:nth-child(4n+0)").addClass("no-padding-right");
    < /script >

    Or you could use margin-left and on your LI’s and put a negative margin of the same value on your UL. No jQuery or plugin necessary.

  • #3 / Jan 23, 2011 8:29pm

    catch

    7 posts

    Or you could use margin-left and on your LI’s and put a negative margin of the same value on your UL. No jQuery or plugin necessary.

    Wow! thank you so much, that worked exactly how I wanted, I always tend to over think these simple solutions with EE. I don’t even need the {nth} plugin now.

    :D

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

ExpressionEngine News!

#eecms, #events, #releases