We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 43280
    • 15 Posts
    Hello a quick question about getResources in use with Articles.

    I have a small section on my "main" page that uses a getResources call to display the few newest posts from my articles container. The code is as follows:

    [[getResources? &parents=`15`&tpl=`custom.ArticleRowTpl` &showHidden=`1` &limit=`2`
    &includeContent=`1` &includeTVs=`1` &processTVs=`1`]]


    Now this works as intended, except when i added the &includeTVs variable, it worked but instead of showing an output like the aricles container:

    Tags: Tag1, Tag2, Tag3



    it shows up like this with get resources:

    articles.tags: Tag1, Tag2, Tag3 etc


    Is there something i need to add to the getResources call to change it to act like how the articles container acts? I just want it to output "Tags: " instead of "articles.tags". Thanks for any insight! [ed. note: wonderfulweb last edited this post 13 years, 5 months ago.]
      • 42562
      • 1,145 Posts
      Do you wish to show articles that have a certain tag, or just list the tags in your site?
      Pray tell, what is the content of custom.ArticleRowTpl ?
        TinymceWrapper: Complete back/frontend content solution.
        Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
        5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
        • 43280
        • 15 Posts
        Quote from: donshakespeare at Apr 29, 2013, 09:37 PM
        Do you wish to show articles that have a certain tag, or just list the tags in your site?
        Pray tell, what is the content of custom.ArticleRowTpl ?

        hello, and thank you for your response. I apologize for not responding faster, I had an issue with my webhosting and was locked out of my modx manager due to some issues they had with an update. Back on now so let me provide you with the information you asked for:

        this is the custom.ArticleRowTpl code:

        <div class="blogBubble">
            <div class="entryTitle"><h3><a href="[[~[[+id]]]]">[[+pagetitle]]</a></h3></div>
            <p class="tagLine">[[+tv.articlestags:notempty=`   <span class="tags">[[%articles.tags]]: [[!tolinks? &items=`[[+tv.articlestags]]` &target=`[[*id]]` &useTagsFurl=`1` ]]</span>`]]</p>
            <div class="entryLens">
        	    <p class="blogParagraph">[[+introtext:default=`[[+content:ellipsis=`400`]]`]]</p>
            </div>
            <p class="postMeta">
              <span class="links">
                <a href="[[~[[+id]]]]" class="readmore">[[%read more]]</a>
                [[+comments_enabled:is=`1`:then=`| <a href="[[~[[+id]]]]#comments" class="comments">[[%articles.comments]] ([[!QuipCount? &thread=`article-b[[+parent]]-[[+id]]`]])</a>`]]
                | <span class="date">[[+publishedon:strtotime:date=`%b %d, %Y`]]</span>
              </span>
            </p>
        </div>



        It's very similar to what is essentially the "default" ArticleRowTpl, with a few CSS classes in my stylesheets. I use this to style my blog entries and it all works just fine, there is a section for the title, and under it, it displays "Tags:" and then whatever tags i have used when creating the article.

        However, my issues seems to be with getResoruces on my "main" page; in my getResources call, I use the same tpl I use with my blog posts. but when getResources displays it's output, it doesnt say "Tags:" like articles within the container do; it displays "articles.tags" and then whatever articles tags are associated with those posts. ...Im not exactly sure if its something to do with my Getresources code, or if i need to modify the articleRow tpl. but All im trying to achieve is to get rid of this "articles.tags" and replace it with "Tags" to be uniform with how it looks in the blog container.

        edit:

        I'm reading this and it all seems a bit confusing; so I will attach a few images to help further illustrate my problem:

        --When i go to the "articles" page, using "customRowTpl" it looks like attachment 1. (this is how it SHOULD look)

        --when on the main page, getResources displays the post like attachment 2 (unintended)

        I'm trying to figure out how to get both pages to show the tags like attachment 1.
        [ed. note: wonderfulweb last edited this post 13 years, 5 months ago.]
          • 42562
          • 1,145 Posts
          Okay, I understand you now.
          Your code is fine except for where the problem lies.
          <span class="tags">[[%articles.tags]]: ...

          Think of this placeholder [[%articles.tags]] as a variable that is declared (stands for Tags) only and only in Articles.
          If used outside of Articles, say on your homepage, it would be utterly useless, that is, it'd return as is, and no longer representing the word Tags.

          So just replace [[%articles.tags]] with whatever word you like; like so:
          <span class="tags">Tags: ...

          Cheers
            TinymceWrapper: Complete back/frontend content solution.
            Harden your MODX site by passwording your three main folders: core, manager, connectors and renaming your assets (thank me later!)
            5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
            • 43280
            • 15 Posts
            Quote from: donshakespeare at May 01, 2013, 09:22 AM
            ...


            Ah, I get it now with the explanation. Worked perfectly. Still learning, but it's funny how the small things seem to get me more than anything tongue

            Thanks again.