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

    I’m using revo 2.1 and am trying to build a blog that has something like a gallery-style front page. Every Blog Post should be represented as a Image that can be clicked to get to the blog post.
    I was thinking of using an Image-template variable in my blogPost chunk but unfortunately the tv isn’t accessed.
    I tried the following code in my blogpost chunk:

    <div class="post">
        <h2 class="title"><a href="[[~[[+id]]]]">[[+pagetitle]]</a></h2>
          <div class="entry">
        <p>[[+introtext]]</p>
    <a href="[[~[[+id]]]]" class="readmore">[[*projektimage]]</a>
        </div>
        <p class="postmeta">
          <span class="links">
    <a href="[[~[[+id]]]]" class="readmore">Read more</a>
        </p>
    </div>


    the [[*projectimage]] call should load the picture defined for each ressource but unfortunately this isn’t working.


    Can anyone help me with this? Would be great!

    Thanks a lot!
      https://www.beautyislife-shop.de - premium make-up!
      https://www.topsterne.de - sell it here!
      ---------------------------------------------------------
      • 36446
      • 184 Posts
      got it working - had to set "processtvs" to true in Snippet Properties.

      Edit: oh - i noticed that have a theoretical problem here ... smiley The tv is accessed but only the one from the parent page - not from the child pages. but i need the child tv values to be accessed here. Is this possible?

      Edit2: Ok found a solution - not elegant but working: just put the file-name of the image in the intro text field, and then use something like this in the chunk:
      <a href="[[~[[+id]]]]" class="readmore"><img src="assets/images/ProjektStartImages/[[+introtext]]" alt="Projekte"></a>
        https://www.beautyislife-shop.de - premium make-up!
        https://www.topsterne.de - sell it here!
        ---------------------------------------------------------
        • 22427
        • 793 Posts
        The tv is accessed but only the one from the parent page - not from the child pages
        So you should use [tt][[+projektimage]][/tt] instead of [tt][[*projektimage]][/tt] , don’t you?
          • 18373 ☆ A M B ☆
          • 3,141 Posts
          Quote from: ottogal at Jun 01, 2011, 07:26 AM

          The tv is accessed but only the one from the parent page - not from the child pages
          So you should use [tt][[+projektimage]][/tt] instead of [tt][[*projektimage]][/tt] , don’t you?

          Exactly tongue

          [[*projektimage]] is template variable syntax, but using getResources or other snippets that you pass templateing chunks to, it’s important to realize that the snippet set certain placeholders which often get the value of a certain resource or item being processed at that point in the script. And placeholders are accessed with the [[+tag]] syntax.

          Also, you only need to set processTVs if you are using output types (eg html tag, or image) and don’t want the raw value (image path).
            Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

            Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
            • 36446
            • 184 Posts
            thanks for clarifying. I tryed [[+projektimage]] but unfortunately this is not working at all. now not even the standard value is shown.
              https://www.beautyislife-shop.de - premium make-up!
              https://www.topsterne.de - sell it here!
              ---------------------------------------------------------
              • 18373 ☆ A M B ☆
              • 3,141 Posts
              Try [[+tv.projektimage]] - depending on what addon you use it may prefix it. I think getResources by default prefixes it with tv.
                Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
                • 36446
                • 184 Posts
                Try [[+tv.projektimage]]

                Thank you very much! This solved it! Modx is great and the support is also great!


                  https://www.beautyislife-shop.de - premium make-up!
                  https://www.topsterne.de - sell it here!
                  ---------------------------------------------------------