We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • My personal view is on the side of not allowing clients/customers to ever deal with tags even if html comment tags. They may be handy for people who are not afraid of markup but I always prefer to guide clients to think about things like summaries or introductions as separate from the main content. Additionally, it does't paint me into a corner when the client wants to use that part of the content differently.
      Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. BlogTwitterLinkedInGitHub
    • @Paulp - for your scenario, you can just use an output modifier to truncate the content on templates where you only want the partial content whether you use Ditto/getResources or just the content tags.
        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
        • 37859
        • 34 Posts
        Hello,

        Thanks for your answers !
        Finally some time to try the solution of Bob.
        But can't get it to work in evolution.
        Any suggestions what i'm doing wrong ?
        My snippet called textSplitser :
        <?php
        $delimiter='###'; // or whatever
        $text = explode($delimiter,$inhoud);
         
        $modx->setPlaceholder('rnTekst1',$text[0]);
        $modx->setPlaceholder('rnTekst2',$text[1]);
         
        return '';
        ?>


        In my template i use :
                 
        <div id="tekst">
          [[textSplitser? &content=`[*content*]`]]
          [+rnTekst1+]
        </div>
        <div>...some other div with a slider...</div>
        <div id="nexttekst">
          [+rnTekst2+]
        </div>
        

        But I don't get any output...

        Thanks in advance !
          • 3749
          • 24,544 Posts
          It's been a long while since I've worked with Evo, but I think this is what you want for the second line of that template code:

          [[textSplitser? &inhoud=`[*content*]`]]



          The variable name used in the code has to be the same as the property name in the tag.
            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
            • 37859
            • 34 Posts
            Thanks Bob, but even that change doesn't give me any output.
            Must be something stupid I missed...

            Any other possible solution ?

            Sorry, forgot to mention it is in a multilingual site !
            I use YAMS for the languages and maybe that is causing the problem.

            Thanks in advance !
            [ed. note: bendy4 last edited this post 11 years, 3 months ago.]
              • 3749
              • 24,544 Posts
              I'm not familiar with YAMS, but I doubt if that's it.

              You could try this -- it's how you get properties in Revo, maybe it works in Evo. Also, check all the spellings (they're case-sensitive).

              $text = explode($delimiter,$scriptProperties['inhoud']);


              Try calling the snippet uncached:

              [!textSplitser? &inhoud=`[*content*]`!]



                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
                • 4041
                • 788 Posts
                Maybe this will help:

                snippet call:
                [!textSplitser!]

                snippet code:
                <?php
                $delimiter='###'; // or whatever
                $text = explode( $delimiter, $modx->documentObject['content'] );
                  
                $modx->setPlaceholder( 'rnTekst1', $text[0] );
                $modx->setPlaceholder( 'rnTekst2', $text[1] );
                ?>
                
                  xforum
                  http://frsbuilders.net (under construction) forum for evolution
                  • 3749
                  • 24,544 Posts
                  Ah . . . good old documentObject. wink

                  It's deprecated (and gone) in Revolution and I had forgotten about it.
                    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
                  • Maybe the whole "content" concept needs an overhaul! I would prefer the content to be just another TV, so the layout could be easily reorder as:
                    IntroTV
                    ContentTV
                    SideboxTV
                    etc.
                    I have many pages which don't use the content-field at all because they just display a snippet.

                    BTW.: Speaking of UI/UX – Arranging TVs by numbers still is like the stone age of web. ;-) When will this become dragable like the dashboard widgets already are?
                      MINDEFFECTS – DESIGN for PRINT, WEB and MEDIA
                      http://twitter.com/mindeffects · http://www.facebook.com/mindeffects · http://www.youtube.com/mindeffects/ · skype://mindeffects_oliver
                      • 36926
                      • 701 Posts
                      Quote from: mindeffects at Jan 31, 2013, 08:44 AM
                      I would prefer the content to be just another TV, so the layout could be easily reorder as:

                      You can always hide the content using form customisation if it's no use and then set up a TVs for:
                      IntroTV
                      ContentTV
                      SideboxTV