Answer the question
In order to leave comments, you need to log in
Ditto loses placeholders on output
Immediately an example from life.
There is MODx Evo, there is such a call to Ditto:
<section class="news">
<header>
<h1>{{resource-title}}</h1>
</header>
</section>
<article class="news-item">
<header>
[+news-image+]
<date class="date">
[+date+]
</date>
<h2>
{{resource-title-tpl}}
</h2>
</header>
{{if-intro-tpl}}
{{if-readmore-tpl}}
{{if-main-tpl}}
</article>
[+introtext:ne=``:then=`<section class="pre"><p>[+introtext+]</p></section>`:else=``+]
<article class="news-item">
<header>
[+news-image+]
<date class="date">
[+date+]
</date>
<h2>
<!--{{resource-title-tpl}}--> [+longtitle:ne=``:then=`[+longtitle+]`:else=`[+pagetitle+]`+]
</h2>
</header>
<!--{{if-intro-tpl}}-->[+introtext:ne=``:then=`<section class="pre"><p>[+introtext+]</p></section>`:else=``+]
{{if-readmore-tpl}}
{{if-main-tpl}}
</article>
Answer the question
In order to leave comments, you need to log in
Do not confuse, but it does not help, just like unchecking the caching resource. Just like clearing the MODx cache completely.
As far as I remember, Ditto does not process nested chunks, and they are processed by the modx parser after the snippet is called.
Try to rewrite the assets/snippets/ditto/classes/ditto.inc.php near line 259 like this:
function render($resource, $template, $removeChunk,$dateSource,$dateFormat,$ph=array(),$phx=1,$x=0) {
I didn’t understand something: I commented out the chunk call in the ditto template and added a placeholder with phx next to it. I look at the code - everything is generated, in the comments too! How is that?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question