3

Excuse me if this question is slightly unclear, as i'm having trouble working out the logic to it. On the feature section of my blog page - which can seen in the image attachment above. I am dragging data from the playa module to display feature previews of the most recently uploaded features posted onto the site.

The features on my site are separated into 6 category sections, energy, sport, sleep, wellness, perform, relax.

I want to display one of each of the most recently uploaded features from each category. for the example, one feature will display a post from the the sleep category, one form the energy category and so on...

This is want i have tagged in my template thus far.

{exp:playa:children field="feature_previews" limit="6"}
    <li>
        <a href="{url_title_path='blog/full-post'}">
        <div class="featured-tab {url_title}"></div>
            <img src="{feature_assets}{feature_preview_image}{/feature_assets}" alt="placeholder"></a>
                <p>{feature_assets}{feature_copy}{/feature_assets}</p>
            {/feature_assets}
</li>
{/exp:playa:children}

From the tagging above is there anything i need to add in the loop order differentiate category per post?

This demonstrates what i am trying to achieve

0
3

Playa's an odd solution for this problem, unless you're creating several pages that are linking to different sets of featured pages.

If the goal is to simply display the most recently created feature in each category, an easier, self-managing approach would be to just loop through your categories and display the most recent post from each:

{exp:channel:categories style="linear" category_group="1|2|3" channel="x" show_empty="no"}
    {exp:channel:entries dynamic="no" category="{category_id}" limit="1"}
       [all of your entry markup goes here]
    {/exp:channel:entries}
{/exp:channel:categories}

There are other approaches you could take as well, depending on your content; you could also use a custom field, status, or another category to flag articles as "featured," and update the code above as appropriate.

1
  • Thanks, i'l give this method, i'm trying to create a blog, i guess you method is the most appropriate
    – NewBoy
    Dec 20 '12 at 15:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.