L
L
LittleFatNinja2015-02-15 13:27:46
CMS
LittleFatNinja, 2015-02-15 13:27:46

MODX evo how to call a chunk with parameters?

there is a snippet in which the {{newsBlock}} chunk should be called N times

<?php
for ( $i = 0; $i < $n; $i++ ) {
   echo '{{newsBlock}}';
}
?>

and in the chunk itself {{newsBlock}}
<div class="newsBlock">
    <p class="title"></p>
    <p class="content"></p>
</div>

how to display in {{newsBlock}} title and content of topics whose id is 1,2,3...etc?
i.e. in the end it should turn out:
<div class="newsBlock">
    <p class="title">Title 1</p>
    <p class="content">Content 1</p>
</div>
<div class="newsBlock">
    <p class="title">Title 2</p>
    <p class="content">Content 2</p>
</div>
....

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oleg Pavlov, 2015-02-15
@onpavlov

Recently I came across, output something like this

A
AlexBukh, 2015-04-13
@AlexBukh

Hello, I did not deal with Evo! but in revo you can make placeholders in a chunk and call a chunk with parameters where the name of the parameter is the name of the placeholder

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question