[[+content_image]]
A
A
Alexander Mishchenko2020-05-27 12:29:35
MODX
Alexander Mishchenko, 2020-05-27 12:29:35

How to pass the value of the Extra field (TV) in pdoResources to the &resources value?

I need the person in TV to indicate the id of the entry separated by commas and that this id be passed to pdoResources as the &resources value.

[[pdoResources?
  &parents=`0`
  &depth=`0`
  &includeTVs = `revel-post_manual`
  &processTVs = `revel-post_manual`
  &resources=`[[*revel-post_manual]]`
  &limit=`5`
  &tpl=`relev_post_tpl`
  &useWeblinkUrl=`1`
  &sortby=`RAND()`
  &tplCondition=`template`
  &tplOperator=`==`
  &conditionalTpls=`{"14":"fourth_level"}`
]]

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
P
Pavel Romanov, 2020-05-27
@rpa_design

Make the TV revel-post_manual type "Multiple choice", in the "Possible values" write:

@EVAL return $modx->runSnippet('pdoResources',array(
'parents'=>5, // ID контейнера откуда получать варианты для выбора
'limit'=>0,
'sortby'=>'{ "pagetitle":"ASC" }',
'tpl'=>'@INLINE [[+pagetitle]] (87685)==87685',
'outputSeparator'=>'||'
));

In the "Selection Options" select "Delimiter" and set it to a comma.
In the call on the page, specify:
[[pdoResources?
&resources=`999999999`
//.......
]]

A
Alexander Mishchenko, 2020-05-27
@xxxsanchosxxx

You need to carefully look at the name of the parameters

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question