We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 35594
    • 2 Posts
    Apologies if this is a newb question but I’m having issues with the getResources snippet. Any help would be highly appreciated and I promise to help others if I ever stop being a newb!

    All I want to do is get the TV of a specified resource to display. However no matter what I do it will display the TV according to which ever page I’m on. Is there a way to ovveride this so it points to a specified resource ID. After experimenting with the parameters I can get the array to return the page I want however when I include the TpL it seems to revert back to getting the TV of the current page.



    [[!getResources?

    &parents=`0`
    &showHidden=`1`
    &hideContainers=`0`
    &depth=`0`

    ]]


    Array
    (
    [tpl] =>
    [tplOdd] =>
    [tplFirst] =>
    [tplLast] =>
    [sortby] => publishedon
    [sortbyTV] =>
    [sortbyTVType] => string
    [sortbyAlias] =>
    [sortbyEscaped] => 0
    [sortdir] => DESC
    [sortdirTV] => DESC
    [limit] => 5
    [offset] => 0
    [tvFilters] =>
    [depth] => 0
    [parents] => 0
    [includeContent] =>
    [includeTVs] =>
    [showHidden] => 1
    [showUnpublished] =>
    [showDeleted] =>
    [resources] =>
    [processTVs] =>
    [tvPrefix] => tv.
    [idx] => 1
    [first] => 1
    [last] => 2
    [toPlaceholder] =>
    [toSeparatePlaceholders] =>
    [debug] =>
    [where] =>
    [hideContainers] => 0
    [id] => 11
    [type] => document
    [contentType] => text/html
    [pagetitle] => US P3 Forum
    [longtitle] =>
    [description] =>
    [alias] =>
    [link_attributes] =>
    [published] => 1
    [pub_date] => 0
    [unpub_date] => 0
    [parent] => 0
    [isfolder] => 1
    [introtext] =>
    [richtext] => 1
    [template] => 5
    [menuindex] => 1
    [searchable] => 1
    [cacheable] => 1
    [createdby] => 1
    [createdon] => 2011-05-18 12:50:32
    [editedby] => 1
    [editedon] => 2011-05-19 11:00:24
    [deleted] =>
    [deletedon] => 0
    [deletedby] => 0
    [publishedon] => 2011-05-18 12:50:00
    [publishedby] => 1
    [menutitle] =>
    [donthit] =>
    [haskeywords] =>
    [hasmetatags] =>
    [privateweb] =>
    [privatemgr] =>
    [content_dispo] => 0
    [hidemenu] => 0
    [class_key] => modDocument
    [context_key] => web
    [content_type] => 1
    )

      • 35594
      • 2 Posts
      Solved it...Was using [[*templateVar]] instead of [[+templateVar]]
        • 7391
        • 49 Posts
        How did you end up doing this? I’m having the same problem.. i want to reference the tv settings of a resource from another resource.

        This ofcourse wont work but kinda the idea..
        [[*templateVar? &id=`11`]]
          • 3749
          • 24,544 Posts
          Quote from: digitalmaster at Jun 06, 2011, 08:47 AM

          How did you end up doing this? I’m having the same problem.. i want to reference the tv settings of a resource from another resource.

          This ofcourse wont work but kinda the idea..
          [[*templateVar? &id=`11`]]


          If you’re using an extra like getResources to display them, using [[+templateVar]] will do it. If you’re not, I think you can do it with the getResourceField extra.

            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
            • 7391
            • 49 Posts
            Awesome!! did it like this

            [[getResourceField? &id=`[[+id]]` &field=`tvname` &isTV=`1`]]


            Modx Rocks!!!!!
              • 3749
              • 24,544 Posts
              That it does. grin
                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