[[+content_image]]
A
A
Anton Parkhomenko2019-10-22 10:25:56
MODX
Anton Parkhomenko, 2019-10-22 10:25:56

How to link to category and subcategory in Modx revo?

Good day.
Can you please tell me how to get a link to the category and subcategory in which the resource is contained?
At the moment, resources are displayed using the code:

[[!pdoPage?
      &elementClass=`modSnippet`
      &tpl=`ResTpl`
      &includeTVs=`1`
      &includeContent=`1`
      &processTVs=`1`
      &parents=`2`
      &hideContainers=`1`
      &limit=`20`
      ]]

ResTP code:
<div class="card mb-4">
  <div class="card-body">
  [[+content]]
  </div>
  <div class="card-footer text-muted">
   <a href="ссылка на категорию">Название категории</a> | <a href="ссылка на подкатегорию">Название подкатегории</a>  <br><br> [[!xLike? &parent=554382]]
  </div>
</div>

The code behaves incorrectly when moving from a category to a subcategory.

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
D
Dmitry, 2019-10-22
@Astrawelt

- to the category (current document)
- to the parent document

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question