Make relationship between articles from different container

It works for the container page, I mean in the loop. But when I go to a single page, the below code doesn’t show the assigned artist properly, when I assign any artist who works for some program and doesn’t work for some.

But when the *assign_artist select field is empty, it shows some article instead of the artist.

If I debug the [[*assign_artist]], it outputs nothing when empty. So, how does it display some posts from the program container?

Waiting for your assistance. Thanks.

[[!pdoResources:!empty=`
      <li>
          Artist: 
          <span>
              [[!pdoResources?
                  &tpl=`@CODE:<a href="{{~{{+id}}}}">{{+pagetitle}}</a>`
                  &resources=`[[*assign_artist:replace=`||==,`]]`
                  &parents=`0`
                  &outputSeparator=`, `
              ]]
          </span>
      </li>
  `?
      &tpl=`@CODE:<a href="{{~{{+id}}}}">{{+pagetitle}}</a>`
      &resources=`[[*assign_artist:replace=`||==,`]]`
      &parents=`0`
      &outputSeparator=`, `
  ]]

???

Not exactly sure what you’re doing, but I guess you should check the value of [[*assign_artist]] and not the return value from pdoResources. Something like:

[[*assign_artist:!empty=`
      <li>
          Artist: 
          <span>
              [[!pdoResources?
                  &tpl=`@CODE:<a href="{{~{{+id}}}}">{{+pagetitle}}</a>`
                  &resources=`[[*assign_artist:replace=`||==,`]]`
                  &parents=`0`
                  &outputSeparator=`, `
              ]]
          </span>
      </li>
`]]

Like in this post:

I have an artist(Kunstler) container

I need to show the artist(Kunstler) in the Program(Article)

When I go to the program there is an option to select the artist(Kunstler).

Now,

Issue-1: Programm - Stiftung Starke

Earlier the below code was working in the program container. But it’s not working now.

[[pdoResources?
    &parents=`3`
    &includeTVs=`article_type, date_from, expire_date, post_feature_image, assign_artist`
    &processTVs=`1`
    &where=`{
        "date_from: >= ": "[[!getDate:date=`%Y-%m-%d 00:00:00`]]",
        "expire_date: >= ": "[[!getDate:date=`%Y-%m-%d 00:00:00`]]"
    }`
    &tpl=`program_item`
]]

Issue-2: Archiv - Stiftung Starke

Hence, the program container is not working please visit the archive container page to check the assigned artist is not working. Please also keep in mind the issue of program container that is fetched by pdoResources and archive container fetched by below code.

[[!getPage?
    &element=`pdoResources`
    &parents=`3`
    &sortby=`{"published":"DESC"}`
    &includeTVs=`article_type, date_from, expire_date, post_feature_image, assign_artist`
    &where=`{
        "expire_date: < ": "[[!getDate:date=`%Y-%m-%d 00:00:00`]]"
    }`
    &tpl=`program_item`
    &limit=`10`
    &setTotal=`1`
  ]]

Issue-3: Archiv - Stiftung Starke

Code in the archive container:
[[!Archivist? &parents=3 &target=50 &tpl=ArchivistTpl &useMonth=0]]

Code in the ArchivistTpl:

<li class="[[!+active:class=`active`]]">
    <a class="[[!IsActiveYear? &year=`[[+year]]`]]" href="[[+url]]">[[+year]]</a>
</li>

Earlier this archivist was working fine to filter the programs by year but now it’s not working.

Note: The reason I was writing earlier, my database was full and I removed the cache from the database manually because I was unable to go to the manager.

Sorry for asking a lot of issues, because of fewer resources I always ask here.
Waiting for your assistance.
Thanks in advance.

not working the above code

So what has changed on the server in the meantime?
What exactly do you mean by “not working”? Does the snippet call just doesn’t return anything?
Are there any (related) error messages in the MODX error log (that get added when you request this page)?

There is no cache in the database! Do you mean you deleted the content of the folder core/cache/?

From the screenshot, it looks like the TV “assign_artist” returns all the value in the list without any separator ( → 2102112122132162172...).
How is this value stored in the database (table modx_site_tmplvar_contentvalues)?
What “Output Type” is selected for this TV? (tab “Output Options” in the TV settings.)