We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28513
    • 53 Posts
    I have used ditto quite a bit to show recent news, or blog posts on a homepage, but I can’t figure out how to simply show a small portion of text from another basic content page. With the recent news I can set the parent ID and it pulls in the children. But the page I want to show content from has nothing under it. How do I show the content from a main level page, is ditto still what I want?

    Basically my set up has a small bio section in the footer, I will be showing a small amount of bio text in the footer and then it will link to the actual bio page.

    Thanks in advance for the help.
      • 26931
      • 2,314 Posts
      sure, Ditto can do that .... the Ditto template is totally customizable e.g. truncate the content:
      http://www.pogwatch.com/ditto/ditto-extenders/ditto-summary.html
      .. or with a PHX modifier:
      http://wiki.modxcms.com/index.php/PHx/CustomModifiers#phx:character_limit

      if it’s just one ressource you want to pull content from it’s probably better to just use a TV with @DOCUMENT Binding http://www.sottwell.com/tv-bindings.html ... then truncate the text with the modifier above ( or another one ).

      ... using the getField Snippet is another option
        • 28513
        • 53 Posts
        Thank you for the reply. Got what I needed using the @DOCUMENT binding. Is there an easy way to show only text (paragraphs) and not images or headings? If not I can use use the style sheet to hide those elements in that area.
          • 26931
          • 2,314 Posts
          Hi Steve,

          Is there an easy way to show only text (paragraphs) and not images or headings? If not I can use use the style sheet to hide those elements in that area.
          you could do that in combination with PHX and one of those modifiers ... there are aome around for paragraphs e.g. http://modxcms.com/forums/index.php/topic,40251.msg255963.html#msg255963
            • 28513
            • 53 Posts
            Ok, I am almost there. I think GetField is going to work for me best since I want it to show on everypage in the footer.
            So my last question is how to a truncate it? Currently I was doing this:

            [*footerContent:len:gt=`324`:then=`[*footerContent:character_limit=`324`*]`:else=`[*footerContent*]`*]<a href="/about.php">read more</a>
            


            What do I add to this to make it do the same?
            [!GetField?docid=`4` &field=`content`!]