K
K
Kalwin UA2020-06-24 16:13:00
MODX
Kalwin UA, 2020-06-24 16:13:00

How to output content using pdoResources?

Initially, the issue was resolved in this thread , then I used getResources. But after the advice of the user, I decided to use pdoTools, as it turned out to be more convenient. But even here it was not without questions.
Specifics again, desired result, table with contents:
5ee87ad658211996154581.png
List of resources used:
5ef34fc7c1a5d367275756.png
Code to call at the top level (document 2 - Price list):

<h2 class="w-100 text-center">Вопрос</h2>
<div class="table-responsive-xs table-responsive-sm table-responsive-md">
    <table class="table table-bordered table-hover table-sm">
        <caption>Ждем ваших звонков и сообщений!</caption>
        <thead class="thead-dark">
            <tr>
                <th scope="col" class="align-middle text-left">Наиминование</th>
                <th scope="col" class="align-middle text-center">Ед. изм.</th>
                <th scope="col" class="align-middle text-center">Цена, грн</th>
                <th scope="col" class="align-middle text-center">Цена, грн нов</th>
                <th scope="col" class="align-middle text-center">Цена, грн б/у</th>
                <th scope="col" class="align-middle text-center">до 0,5</th>
                <th scope="col" class="align-middle text-center">от 1кг</th>
                <th scope="col" class="align-middle text-center">от 5кг</th>
                <th scope="col" class="align-middle text-center">Вес</th>
            </tr>
        </thead>
        
        </tbody>
    </table>
</div>

The call is already from the "TableTpl" template:
<tbody class="thead-light">
    <tr>
        <th scope="col" colspan="9" class="align-middle text-left"></th>
    </tr>
</tbody>

Call from "PriceTpl" template:
<tbody>
    <tr>
        <td scope="row" class="align-middle text-left"><a href="" class="text-body"></a></td>
        <td class="align-middle text-center"></td>
        <td class="align-middle text-center"></td>
        <td class="align-middle text-center"></td>
        <td class="align-middle text-center"></td>
        <td class="align-middle text-center"></td>
        <td class="align-middle text-center"></td>
        <td class="align-middle text-center"></td>
        <td class="align-middle text-center"></td>
    </tr>
</tbody>

Received result:
5ef350b4bd836093477861.png

I can't understand why the document "9" is lost, and not all information from the TV fields is displayed.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ruslan, 2020-06-25
@ruslan_aleev

why document "9" is lost

Maybe it's not published?
not all information from TV fields is displayed

Remove &depth, try to turn on &prepareTVs=`1` и &processTVs=`1`
In general, visually everything is correct, it should work.
ps For the future: it's better to use miniShop2 and &tvPrefix=``set it empty so that you write less in the template ( ->)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question