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

    I am trying to use the summary of the web page to populate a description on another page. I have a small graphic panel that I have in a chunk that I call in the template. It may be better to see the website to understand http://www.trawickinternational.com/ .
    I am trying to populate the About us with a short description of a page in the website. I believe I can call the summary of the page or it will collect a certain amount in the page to populate. I am not sure how to go about this. I have read several things and have a small idea, but would like some help. Can anyone give me some direction on how to get tis done? IS there any tutorials?

    Thank you

      • 3749
      • 24,544 Posts
      If you just want to do it with a single page, you probably want the getField snippet. The actual field name is "introtext"

      If you want to grab the summary field from a number of resources, you probably want Ditto (or getResources in MODx Revolution). In that case, the field would be referred to with this tag:

      [+introtext+] (Evolution)
      [[+introtext]] (Revolution)

        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
        • 32347
        • 143 Posts
        I am new to using the Ditto, so I ahve been reading as much as I can about it. I am starting to understand, but still have some holes to fill.

        I have the pages displaying through this tag

        [[Ditto? &parents=`0` &extenders=`summary` &truncLen=`140`]]

        but, I am trying to get a "specific pages content" to list a summary and have a link to click for more. I know I am close. The current ditto tag list all the pages when I put a "o" in the tag

        Thank you

          • 3749
          • 24,544 Posts
          I’m not completely clear on what you want, but check out the &includeDocs parameter.
            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
            • 32347
            • 143 Posts
            I am trying to get the summary of one page into another page using the ditto.


              • 3749
              • 24,544 Posts
              Sorry, wrong parameter. For Ditto, the parameter is &documents. If you wanted to pull the summary from document 12, I think this would do it:

              [[Ditto? &documents=`12` &extenders=`summary` &truncLen=`140`]]


              Actually, if you only want one document’s summary, it would be much faster and easier to use the getField snippet and just retrieve that document’s introtext field.

              http://modxcms.com/extras/download/285/285

              I think the tag would look like this:

              [!getField? &docid=`12` &field=`introtext`!]
                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
                • 32347
                • 143 Posts
                Thank you. I had tried the &documents but it did not work for me, but now it does.

                Not sure why.

                This is what is displaying for me.

                About
                by Default admin account on 31-May-10 14:46
                Trawick International is a Global Insurance and Financial Specialist with expertise in International Student Health Insurance as well as Global Trip Insurance

                is there a way to get it with out the date and time. I just want a summary

                Thanks
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  Then you need to use a custom tpl for the output.

                  http://www.pogwatch.com/ditto/ditto-templates.html
                    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
                    • 32347
                    • 143 Posts
                    Thank you, I have it displaying what is below.
                    About

                    Trawick International is a Global Insurance and Financial Specialist with expertise in International Student Health Insurance as well as Global Trip Insurance
                    more...

                    I still have some questions.
                    1. How do I get the "about" which is the title of the page out of the display?
                    2. How can I style the out put?
                    3. is there a way just to get a summary from the content of the page rather than having to place the summary of the text in the summary?

                    thanks
                      • 18373 ☆ A M B ☆
                      • 3,141 Posts
                      Quote from: wholein1 at Jun 08, 2010, 04:44 PM
                      I still have some questions.
                      1. How do I get the "about" which is the title of the page out of the display?
                      2. How can I style the out put?
                      3. is there a way just to get a summary from the content of the page rather than having to place the summary of the text in the summary?

                      thanks
                      In regards to Q1 & Q2:
                      Quote from: sottwell at Jun 05, 2010, 11:17 PM

                      Then you need to use a custom tpl for the output.

                      http://www.pogwatch.com/ditto/ditto-templates.html
                      The "about" title is most likely referenced to as [+pagetitle+] in the ditto template.

                      You can use CSS to style the output html as you place it in the ditto template. If you’re unfamiliar with CSS try the tutorials over at the W3C: http://www.w3schools.com/css/

                      As for Q3: back in version 1 of Ditto there was the [+summary+] placeholder. Used with &extenders=`summary` in your ditto call. However, one site just mentioned it has been deprecated and another says it still works. I’ve not tried it out, but would be worth the try wink
                        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.