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

    I’m not sure if this is a new-feature request/idea or an how-to question
    ... but being able to display a thumbnail togheter with the summary of a post would be great;

    I believe the solution is in those
    [+documentobject+] and [+tvnameoftv+] placeholders that I did not care to understand nor test yet! ...am I right?!
      ----------------------------------------------------------
      http://www.linkedin.com/in/lucapost/
      http://www.twitter.com/lukwe/
      ----------------------------------------------------------
      • 18397
      • 3,250 Posts
      MARKSVIRTUALDESK Reply #2, 20 years ago
      Yes, you are correct.

      You simply need to create a new image TV, associate it with your document, and then add <img href="[+tvyourtvname+]" /> in your Ditto template.
        • 17673
        • 194 Posts

        Ok, got it working with the TV ( ’<img src=[+tvnameoftv+]’ alt="whatever" />
        I did another try with [+documentobject+] which failed.

        I designated one of the images in the article body with a CSS id: [tt]<img src="url/path" id="thumb">[/tt], then, in the Ditto template chunk, I tried using [tt][+thumb+][/tt] but I get no output from it, nor with the ID on the img as above nor by ID-ing a nesting DIV.

        This DOM-like approach (pretty similar to the getElemntbyID() function) would be very general and useful with sub-divs, <p>s, anything in the article body; but probably [+documentobject+] just refers to ModX IDs and not to DOM elements... in this case I can’t quite figure out situations/examples where to use it ?!


          ----------------------------------------------------------
          http://www.linkedin.com/in/lucapost/
          http://www.twitter.com/lukwe/
          ----------------------------------------------------------
          • 18397
          • 3,250 Posts
          MARKSVIRTUALDESK Reply #4, 20 years ago
          Document object is the MODx Document Object ex: pagetitle, description, content, etc., not the DOM.
            • 17673
            • 194 Posts
            ok thanks for the clarification!
            ... support for DOM elements would be very useful though and maybe easier for Modx newbies -keep it in your notes for future realeases!

            Since I am at it with (unasked) suggestions that may_bring_new_ideas_to_the_community_and_keep_the_code_base_tight (?)

            I find a similar ’TV proliferation issue’ with the TAGS implementation; could it all be done by referencing the keywords defined in the modx manager?!?

            Ciao!
              ----------------------------------------------------------
              http://www.linkedin.com/in/lucapost/
              http://www.twitter.com/lukwe/
              ----------------------------------------------------------
              • 8439
              • 89 Posts
              Quote from: Mark at Sep 27, 2006, 01:13 PM

              Yes, you are correct.

              You simply need to create a new image TV, associate it with your document, and then add <img href="[+tvyourtvname+]" /> in your Ditto template.
              But this just displays the original image right? How could I display a thumbnail, i.e. a reduced size image?

              Ed
                • 18397
                • 3,250 Posts
                Use one of the thumbnail generating snippets contained in the forums.
                  • 3493
                  • 66 Posts
                  ...Or, you might also be able to set the image size through "height" and "width" in the image tag or the CSS, I believe... Am I wrong?