We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19872
    • 1,078 Posts
    I have a series of what I call Detail Pages. Each links to a corresponding Photo Gallery resource.

    When the Photo Gallery resource is displayed, I'd like to have a few of the contents from the other resource brought in, and also have a button that can be clicked to get back to the original Detail Page.

    Thought I had this solved by creating a TV on my Gallery Template to contain the ID of the resource it's associated with, and then use that in a pdoResources call for bringing in the contents I want. I'm doing something wrong though and it's not working as expected.

    So lets say resource 9 is my detail page.
    In my Gallery page I enter the number 9 in the TV field I set up. It's a TV named: detail_ID

    My first chunk that is on the template contains the snippet call
      [[!pdoResources?
        &resources=`[[*detail_ID]]`
        &tpl=`propDetailInfo`
        &limit=`10`
        &includeTVs=`propNeighborhood,propTitle`
        &processTVs=`1`
        &TVprefix=``
        &depth=`1`
        &showHidden=`1`
        ]]
    


    My Chunk is: propDetailInfo
    For now it just contains:
    <p>[[+tv.propNeighborhood]] [[+tv.propTitle]]</p>


    Basically, what I want is that when I create a new gallery resource, I want to be able to enter the ID of another resource in a TV field to be use for importing / including a few TV contents from that resource.

    Can anyone tell me where I'm going wrong with this?

    [ed. note: mmcgee last edited this post 11 years, 7 months ago.]
      • 3749
      • 24,544 Posts
      This might work for part of that: http://modx.com/extras/package/showtv2 [ed. note: BobRay last edited this post 11 years, 7 months ago.]
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 19872
        • 1,078 Posts
        Bob:
        The link you provided is to an add-on developed in 2010 that appears to be some kind of output modifier for TVs

        I circled back around and did a search through the add-ons and found YOUR add-on ShowTV developed in 2012. This one appears to be what I need.

        Question: How to I or can I use a template variable for the value of &resourceID? That value will be different on every resource. I will always be getting the same tv values, but where the come from changes. And where they come from would be number that I enter into a TV field.

        Not sure exactly how to explain this. I create a resource. I enter a number in a TV that is the number of a resource from which I want to get some TV values. That number that I enter then would need to appear in the snippet call.

        [[!ShowTv? &tvID=`12` &resourceID=`*MyTemplateVariableForTheIDNumber` &render=`0`]]
          • 19872
          • 1,078 Posts
          Bob:

          I wish I had discovered the error with the link much much earlier today.

          I loaded YOUR ShowTv Add-On. And it worked exactly like I wanted! Better yet: It accepts a template variable for &resourceID. This is a big plus for me.

           <h3>[[!ShowTv? &tvID=`12` &resourceID=`[[*detail_ID]]` &render=`0`]] [[!ShowTv? &tvID=`18` &resourceID=`[[*detail_ID]]` &render=`0`]]</h3>


          Thanks,

          Marc
            • 3749
            • 24,544 Posts
            Sorry about that. I didn't know there was another one and thought the 2 at the end was a typo I had made (link fixed above).

            I'm glad it worked for you. smiley
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting