We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 52128
    • 29 Posts
    Hi,

    I am using Article-1.7.11-pl add on. Is it possible to have a "Featured Blog" that would highlight and brought to the top no matter when it is published? There is an option in Wordpress, I just couldn't see option in Modx...

    Any suggestion would be appreciated.

    Many thanks

    Magz
      • 4172
      • 5,888 Posts
      that's possible with a checkbox-TV, name it for examlple "featured" with input-option-values like
      featured==1


      Then add an seperate getResources-call at the top of the other articles and filter by that TV with
      &tvFilters=`featured===1`


      To remove the featured Articles from the other Articles, you have to add this property to the current call:

      &tvFilters=`featured!==1`

        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 52128
        • 29 Posts
        Quote from: Bruno17 at Aug 17, 2016, 05:04 AM
        that's possible with a checkbox-TV, name it for examlple "featured" with input-option-values like
        featured==1


        Then add an seperate getResources-call at the top of the other articles and filter by that TV with
        &tvFilters=`featured===1`


        To remove the featured Articles from the other Articles, you have to add this property to the current call:

        &tvFilters=`featured!==1`



        Hi Bruno17,

        thank you for your reply. I am new in modx so bare with me. I got the first bit done but I am stuck in the next two point. I have attached the chunk code below.

         
        
        <a href="[[~[[+id]]]]"><img src="[[pthumb? &input=`[[+tv.image]]` &options=`h=200&w=200&zc=2` &s3output=`6`]]" alt="[[+pagetitle]] photo" style="float:left; margin-right:30px;"></a>
        
        
        
        </span><h3 class="title"><a href="[[~[[+id]]]]">[[+pagetitle]]</a></h3>
            <p class="post-info">[[%articles.posted_by]] <a href="[[~[[*id]]]]author/[[+createdby:userinfo=`username`]]">[[+createdby:userinfo=`username`]]</a>  | [[+publishedon:strtotime:date=`%b %d, %Y`]] [[+comments_enabled:is=`1`:then=`| <a href="[[~[[+id]]]]#comments" class="comments">[[%articles.comments]] ([[!QuipCount? &thread=`article-b[[+parent]]-[[+id]]`]])</a>`]]<br />
            <div class="entry">
        	    [[+introtext:default=`[[+content:striptags:ellipsis=`180`]]`]] </p><b><a href="[[~[[+id]]]]">[[%articles.read_more]] >></b></a><br /><br />[[+tv.articlestags:notempty=`<span class="tags">[[%articles.tags]]: [[!tolinks? &items=`[[+tv.articlestags]]` &target=`[[*id]]` &useTagsFurl=`1`]]</span>`]] 
            </div>
        
        


        Many thanks

        Magz
          • 4172
          • 5,888 Posts
          this is the tpl-chunk which is used for each article in the list.
          This doesn't need to change.

          Must be in the template, which is used by your articles-listing-resource.
          How does that template look like? (I'm not using articles)
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 52128
            • 29 Posts
            Quote from: Bruno17 at Aug 17, 2016, 07:16 AM
            this is the tpl-chunk which is used for each article in the list.
            This doesn't need to change.

            Must be in the template, which is used by your articles-listing-resource.
            How does that template look like? (I'm not using articles)

            Hi Bruno17

            It gather information from the snippet which is this:


            $modx->lexicon->load('articles:frontend');
            
            $container = $modx->getOption('container',$scriptProperties,0);
            if (empty($container)) return '';
            /** @var ArticlesContainer $container */
            $container = $modx->getObject('ArticlesContainer',$container);
            if (empty($container)) return '';
            
            $placeholderPrefix = $modx->getOption('placeholderPrefix',$scriptProperties,'');
            
            $container->getPostListingCall($placeholderPrefix);
            $container->getArchivistCall($placeholderPrefix);
            $container->getTagListerCall($placeholderPrefix);
            $container->getLatestPostsCall($placeholderPrefix);
            $settings = $container->getContainerSettings();
            if ($modx->getOption('commentsEnabled',$settings,true)) {
                $container->getLatestCommentsCall($placeholderPrefix);
                $modx->setPlaceholder($placeholderPrefix.'comments_enabled',1);
            } else {
                $modx->setPlaceholder($placeholderPrefix.'comments_enabled',0);
            }
            return '';


            any idea?

            Thanks

            magz