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

    I would like to use the whole summary on my website (under news - left hand side)for all the text to be the link to the news post rather than using the read more. Currently I have the following:

    <div class="newsstory">

    <p><span class="date">[+date+]</span>

    <p><a href="[~[*id*]~]">[+summary+] </a> </p>

    </div>

    This is not linking to the news post can you please advise what I should do?
      Get your business online - Adapt Web Design www.Adaptwebdesign.com
      • 20448
      • 48 Posts
      Sorry folks the website is www.OsteoPractitioner.com
        Get your business online - Adapt Web Design www.Adaptwebdesign.com
        • 36592
        • 970 Posts
        <p><a href="[~[*id*]~]">[+summary+]</a></p>


        It may be [~[+id+]~].
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Understand the difference between [*...*] and [+...+].

          You have a resource, #1. This resource has the Ditto snippet call on it. This is the current resource, the one MODx is parsing and generating the page from. Any [*...*] tags will be replaced with its value for this current resource.

          In the Ditto snippet, you have given it a list of resources for it to process (for example, the children of resource #1). While Ditto is doing its thing, MODx is waiting for it to finish so MODx can put its output (the list of items you told Ditto to work with) into the documentObject. This Ditto output will contain raw any [*...*] tags you put into your Ditto tpl; Ditto does not work with these tags!!! On the next pass through the parser, MODx will see these [*...*] tags in the source and will replace them with the values of the current resource.

          Ditto processes each resource in the set it was given, applying its tpl to each one in turn. Ditto will replace [+...+] tags with the appropriate value from the resource it (Ditto) is processing. Actually, what Ditto (and Wayfinder and all the other snippets that use mini-tpls to format their output) does is to set a placeholder for every resource setting that it is programmed to recognize, then replaces the placeholder tags in its tpl with that value. It does this over and over again, for each resource in its list of resources to process.

          Ditto does not mess with the [*...*] tags, and MODx has no knowledge of Ditto’s tpl, nor of the [+...+] tags within that tpl. Ditto fetches the chunk (or file or whatever) all by itself, and processes its assigned resources all by itself. When Ditto is finished, then MODx can continue processing the entire documentObject, which now contains the full output of the Ditto snippet, including untouched any [*...*] tags you put in the Ditto tpl.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 20448
            • 48 Posts
            Thanks all sorted
              Get your business online - Adapt Web Design www.Adaptwebdesign.com