Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get a pagetitle based off of a TV #7

Open
adamwintle opened this issue Jun 24, 2014 · 1 comment
Open

Get a pagetitle based off of a TV #7

adamwintle opened this issue Jun 24, 2014 · 1 comment

Comments

@adamwintle
Copy link

Not sure if this is a bug/feature request, or I just can't figure it out, but here's my scenario:

I've got a TV list which the user can choose a resource and the TV outputs the ID of the resource. I then want to use the ID on the page to output other various fields from that page, such as title, content, description, etc

so far I have tried various setPlaceholders queries without any luck:

[[!setPlaceholders?
    &ph=`
    ViewpointsIndustryFashion.title == tv.ViewpointsIndustryFashion.pagetitle !! no title ||
    ViewpointsIndustryFashion.intro == tv.ViewpointsIndustryFashion.introtext !! no introtext
    `

    &prefix=``
    &output=`0`
    &processTVs=`1`
]]

then on the page template:

[[+ViewpointsIndustryFashion.title]]
[[+ViewpointsIndustryFashion.intro]]

If I were to output just [[+ViewpointsIndustryFashion]] I'd get the ID of those resources as expected.

If this type of getResourceFields output method possible with setPlaceholders?

@oo12
Copy link
Owner

oo12 commented Jun 25, 2014

What you want to do is use the value of the TV for the &id property, then all the stuff you reference in &ph will be relative to that resource by default. Viz.:

[[setPlaceholders?
    &id=`[[*ViewpointsIndustryFashion]]`
    &ph=`vif.title == pagetitle !! no title ||
        vif.intro == introtext !! no introtext`
]]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants