[[+content_image]]
B
B
Boshnik2014-08-25 20:06:49
MODX
Boshnik, 2014-08-25 20:06:49

How to get resource id in MODX Revo ?

Hello!
The scheme is this:
pdoResources:

[[pdoResources?
  &parents=`3` // Мне нужны все дети этого родителя
  &depth=`0`
  &tpl=`action_slider` // Подключаю чанк
        &includeTVs=`action_img,button_action` // необходимые tv
]]

Chunk action_slider`:
[[$[[+tv.button_action]]]]
Connect the chunk that we selected in tv button_action
Possible choice TV button_action : button_modal||button_blank
Chunk button_modal:
Первый вариант: 336097
Второй вариант: 2
Chunk button_blank: Output

:
button_modal:
first option - last child id
second option - - id 1 main page
button_blank
parent link
Total resources (children of the parent with id 3) are four.
Thanks to everyone who will respond.

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
P
Pavel Myshkin, 2014-09-04
@Boshnik

I did something similar using PHx:

[[[[+tv.button_action]]:is=`
    button_modal
`:then=`
    336097
`:else=`
    [[[[+tv.button_action]]:is=`
        button_blank
    `:then=`
        2
    `:else=`
    
    `]]
`]]

Most likely, the syntax is lame, and the recording may not be kosher, but you can try.
I wrote you an example of the "action_slider" chunk.

B
Boshnik, 2014-09-04
@Boshnik

Thank you. Didn't know it was possible.)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question