3

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.

Charles
  • 50,943
  • 13
  • 104
  • 142
Meddie
  • 571
  • 1
  • 7
  • 22

2 Answers2

3

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

okyanet
  • 3,106
  • 1
  • 22
  • 16
  • I'm affraid I might need to do that. I was hoping I could put some hook or something in "Display Text:" – Meddie Feb 14 '12 at 20:04
  • Nothing wrong with that at all, that's how it's done :) Also, it's cached so not going to affect performance. No idea what you mean by 'Display Text' – okyanet Feb 14 '12 at 20:07
  • I will use your method if that's how it goes. Thanks. Display text is the field I can fill in that will function as the link text. It's the first field in output type URL – Meddie Feb 14 '12 at 20:14
0

try [*pagetitle*] or [*#pagetitle*].

first one should work fine.

dsgsd
  • 1
  • 1