Search code examples
modxtelevision

TV output url title of resource id


When I create a multi select input where i can select resources and I want the output to be a link to that resource. How can I get to link to read/show the title of the page i'm linking to? I can't find any info about that.

I've tried [[*pagetitle]], but then the link text is the pagetitle of the page i'm currently on.


Solution

  • Assuming your TV outputs the id of the resource you want to link to, you can use getResourceField:

    <a href="[[~[[*yourTV]]]]">[[getResourceField? &id=`[[*yourTV]]` &field=`pagetitle`]]</a>
    

    More on how to use it here: http://rtfm.modx.com/display/ADDON/getResourceField