-
MODX Staff
- 2,502 Posts
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.
Blog ✦
Twitter ✦
LinkedIn ✦
GitHub
-
☆ A M B ☆
- 24,524 Posts
@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.
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.
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 13 years, 8 months ago.]
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*]`!]
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] );
?>
Ah . . . good old documentObject.
It's deprecated (and gone) in Revolution and I had forgotten about it.
-
☆ A M B ☆
- 179 Posts
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?