C
C
Casper9692018-05-03 09:13:33
MODX
Casper969, 2018-05-03 09:13:33

How to display a certain news in a special place in MODX?

Hey!
In general, there is a news site wolsk.ru and now I am transferring it to MODx. There is a headline news on the main page, it should be displayed only if approved by the administrator (i.e. when the checkbox is pressed in the type admin panel) and it should be displayed in the place specified for it (in the center of the screen in the top block). Moreover, this news should also be displayed in the general list of news on the left.
Tell me with what help I can perform such a chip and how is it possible?
I apologize for such questions, I'm just new to this business and, in fact, I only know how to typeset)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey, 2018-05-03
@Casper969

1. Create a TV with the prntscr.com/jd3137 checkbox and specify for which templates it will be available
2. Install the pdotools add-on https://docs.modx.pro/components/pdotools/
3. Enable fenom support in the prntscr.com templates in the settings /jd31i2
4. Write the code in the right place

{'pdoResources' | snippet : [
        'parents' => 4,
        'tpl' => 'ЧАНК_НОВОСТИ(ее_дизайн)',
        'limit' => 1,
        'includeTVs' => 'img, show_index',
        'tvPrefix'=> '',
        'where' => '{"show_index":1}'
      ]}

parents category where news
show_index is tv with a checkbox
, you can specify more additional parameters https://docs.modx.pro/components/pdotools/snippets...
And in the block on the right
{'pdoResources' | snippet : [
        'parents' => 4,
        'tpl' => 'ЧАНК_НОВОСТИ(ее_дизайн)',
        'limit' => 8,
        'includeTVs' => 'img,',
        'tvPrefix'=> ''
      ]}

R
Ruslan, 2018-05-03
@ruslan_aleev

Hello, read a couple of articles on MODX Revo for beginners, for example, modx.ws/uroki/uroki-modx-revolution/vstuplenie.html (there is an old version of MODX, but the syntax and additions are the same), in a couple of days you will understand what and how, not difficult.
Above, you were pointed to the pdoTools package - this is a replacement for older components (Wayfainder, getResources, etc.), you can use the fenom template engine (example above), or you can use the standard MODX template engine without it (see the link to the lessons).

C
Casper969, 2018-05-03
@Casper969

Guys, thank you very much! I will read. I just like this CMS, but there is little information on it, and I only know how to typeset)
PDOtools has already begun to understand a little) I get lost only in its modifiers and other chips with a non-standard solution.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question