New Community Forums are coming. Watch this space for news.
Subscribe: RSS
  • So, I have a section on my website with featured articles:
    <section class="usa-section usa-section-dark usa-graphic_list">
    <div class="usa-grid usa-graphic_list-row">
    [[!getResources? &parents=`-1` &resources=`322,224` &tpl=`featuredarticles` &includeTVs=`1` &processTVs=`1`]]
    </div>
    <div class="usa-grid usa-graphic_list-row">
    [[!getResources? &parents=`-1` &resources=`79,75` &tpl=`featuredarticles` &includeTVs=`1` &processTVs=`1`]]
    </div>
    </section>


    The template looks like this:

    <div class="usa-width-one-half usa-media_block">
          <img class="usa-media_block-img" src="[[+tv.tvImage]]" alt="" width="124" height="124" />
          <div class="usa-media_block-body">
            <h3><a href="[[~[[+id]]]]" title="[[+description]]">[[+longtitle]]</a></h3>
            <p>[[+introtext]]</p>
          </div>
        </div>


    As you see, I manually put the ID´s of the article I want to be featured. How can I automate this?
    • How do you want to select the featured articles (newest, oldest, random)?

      Are the articles under a single parent?

      In terms of how the final page looks, are you displaying one featured articles list or two?

        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/MODx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
      • Quote from: BobRay at Feb 05, 2019, 06:20 PM
        How do you want to select the featured articles (newest, oldest, random)?

        Are the articles under a single parent?

        In terms of how the final page looks, are you displaying one featured articles list or two?


        It would be random selected ones, displayed in one list. The articles that are selected are articles from two parents.
        • In that case you can just set the &parents=`` attribute to the parent(s) you want to pull from and delete the &resources attribute. To sort randomly just add &sortby=`RAND()`
            ■ email: lk@alienbuild.uk | ■ website: https://alienbuild.uk

            The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.