V
V
vlog2022-02-13 11:12:11
MODX
vlog, 2022-02-13 11:12:11

What does modx do "under the hood" when calling TV in a chunk?

It is necessary to display the value of several fields with a check for empty values.
I worked with ready-made code, where each field was simply called in turn through , brought everything into a snippet that accepts TV, a caption to it and gives out an embed code.

Now I'm thinking how to make it more optimal, but I can't know, because I don't know what modx does when is called.
If modx accesses the database every time, then it’s easier for me to transfer the tv names to the snippet and get them there with one request.
If modx has already initially requested these fields, then I can pass to the snippet so as not to make unnecessary requests.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Danny Arty, 2022-02-13
@vlog

During the request, Modx receives the resource and immediately all of its tv-shki. And when accessing tv, it accordingly makes a request in this data and receives a value from there.
I usually, if I need to display a lot of tv-parameters, then I use showTVlist

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question