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

    I am pretty sure, this question was asked before - but I only found solutions for modx evo that don't work.
    I want to have a link with a specific text i am getting from the "introtext" from resource. The chunk is called
    [[$thelink]]
    and looks like this:

     <a href="something" class="button">[[+introtext]]</a> 


    When I am using this
    [[$thelink]]
    inside a resource "content" field I am getting one introtext of one resource, but this one is the only one - even every resource has a value inside its "introtext" field.

    I also tried [[!+introtext]], [[!*introtext]], [[*introtext]] - but no luck....

    Does this have something to do with the getResources?

    [[!getResources? &parents=`0`  &limit=`10` &includeContent=`1`  &includeTVs=`1` &processTVs=`1`  &tpl=`one_page`  &sortdir=`ASC` &sortby=`{"menuindex":"ASC"}`]] 



    What is wrong?

    thank you!

    AD

    This question has been answered by jgrant. See the first response.

      • 22427
      • 793 Posts
      Did you try the chunk uncached?
      [[!$thelink]]


      What's in the chunk one_page?
        • 42101
        • 125 Posts
        Hi ottogal,

        yes I tried the uncached. I am getting only the value of one resource - also when I try to get [[+alias]] it shows me only the one resource as output - not the other ones.

        one_page - is the template I am using to get the pages - I also put [[$thelink]] inside the template...

        thank for the reply,
        ad
          • 22427
          • 793 Posts
          Are you sure that you want to list just the child resources of id=0?
          Are they published?
            • 42101
            • 125 Posts
            you mean
            &parents=`0`
            ?
            it's a "one page" design. But I have several "pages" as resources. All published.

            ad
            • discuss.answer
              • 35150 ☆ A M B ☆
              • 191 Posts
              Instead of [[$thelink]] try [[$thelink? &introtext=`[[+introtext]]`]]
                Extras :: pThumb • Resizer • imageSlim • setPlaceholders
                • 3749
                • 24,544 Posts
                A [[*tag]] will always show the value from the current page. A [[+tag]] is a placeholder tag. It will show the value for a resource being displayed in a list, but only if something sets the value of that placeholder. Usually, that means it has to be in a Tpl chunk specified in a getResources or Wayfinder tag or something similar.

                It's not completely clear what you're doing, but it looks like you want to put your [[+introtext]] tag inside the one_page chunk.
                  Did I help you? Buy me a beer
                  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
                  • 42101
                  • 125 Posts
                  Quote from: jgrant at Apr 05, 2013, 09:27 PM
                  Instead of [[$thelink]] try [[$thelink? &introtext=`[[+introtext]]`]]

                  holy cow! this is working as it should!
                  Nice.
                  Thank you jgrant!