1. REGISTRATION REQUIREMENTS:

    Your username here MUST MATCH your XenForo username (connected to your XF license).

    Once you have registered here, then you need to start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Resolved Sort featured?

Discussion in 'AMS Support' started by Robert9, Jan 4, 2022.

Thread Status:
Not open for further replies.
  1. Robert9

    Robert9 Member AMS Showcase Sportsbook

    Do we have a sort for featured articles?

    My client has

    1. Something about the site
    2. Something about the forum
    3.-5. changing news

    The news are featured/unfeatured everytime a new article comes up.
    1+2 should stay there always, but on position end and end-1.
    The news should stay on 1 to end-2.
    Is there a way to do that, please?
     
  2. Bob

    Bob Developer Staff Member

    I've moved your question to the Support forum. Suggestions are for making a suggestion, not asking questions.

    As to your question, its very VAGUE and lacks details like which featured function are you asking about.
    • There is a Featured Slider/GridBlock function for AMS Home page.
    • There is a Featured Slider/GridBlock function for AMS Category Pages.
    • There is a Featured Index page (all featured content in the system)
    • There is a Featured Articles Widget Definition.
    The first two are fetched via the method Article::findFeaturedArticles(array $viewableCategoryIds) which uses setDefaultOrder($articleFinder->expression('RAND()')); ... in other words, the content in the "Featured Sliders/Grid Blocks" are fetched randomly.

    The third one on the list is handled by an action in the ArticleList Controller Pluggin (actionFeatured). It also uses the method Article::findFeaturedArticles(array $viewableCategoryIds), however, it overrides the default order and sets the order to sort by featured date, descending.
    PHP:
            $finder $this->getArticleRepo()->findFeaturedArticles($viewableCategoryIds);
            
    $finder->order('Featured.feature_date''desc');

            
    $articles $finder->fetch()->filterViewable();
    The last one fetches by random only. I'd be open to updating the Featured Articles Widget Definition to include selecting sort order types like the Latest Articles Widget Definition does.
     
  3. Robert9

    Robert9 Member AMS Showcase Sportsbook

    I am sorry about my english. :(

    I need something like "display_order" for featured articles.

    Some news (10)
    Some news (20)
    Some news (30)
    Something about the site (40)
    Something about the forum (50)
     
  4. Bob

    Bob Developer Staff Member

    Don't be sorry, we've always found a way to communicate ;)

    I highly doubt that this is something I'd consider.

    It might be easier for you to write a custom "featured" system via an Addon to AMS.
     
    Last edited: Jan 6, 2022
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.