We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38175
    • 48 Posts
    Ok. Here is the array output after removing the output tpl. As you can see it is grabbing the image. Still unclear what is happening in the output tpl that suppresses the image. I've tried taking the tv prefix out of the tv name in the output tpl. Thanks.

    		<pre>Array
    (
        [tpl] => 
        [tplOdd] => 
        [tplFirst] => 
        [tplLast] => 
        [sortby] => menuindex
        [sortbyTV] => 
        [sortbyTVType] => string
        [sortbyAlias] => 
        [sortbyEscaped] => 0
        [sortdir] => ASC
        [sortdirTV] => DESC
        [limit] => 10
        [offset] => 0
        [tvFilters] => 
        [tvFiltersAndDelimiter] => ,
        [tvFiltersOrDelimiter] => ||
        [depth] => 0
        [parents] => 1
        [includeContent] => 1
        [includeTVs] => 1
        [includeTVList] => 
        [showHidden] => 
        [showUnpublished] => 1
        [showDeleted] => 
        [resources] => 
        [processTVs] => 1
        [processTVList] => 
        [prepareTVs] => 1
        [prepareTVList] => 
        [tvPrefix] => tv.
        [idx] => 1
        [first] => 1
        [last] => 1
        [toPlaceholder] => 
        [toSeparatePlaceholders] => 
        [debug] => 
        [where] => 
        [dbCacheFlag] => 0
        [context] => 
        [tplCondition] => 
        [tplOperator] => ==
        [conditionalTpls] => 
        [odd] => 1
        [id] => 60
        [type] => document
        [contentType] => text/html
        [pagetitle] => News_11_06_2012
        [longtitle] => This is where the longtitle text appears
        [description] => 
        [alias] => 
        [link_attributes] => 
        [published] => 
        [pub_date] => 0
        [unpub_date] => 0
        [parent] => 1
        [isfolder] => 
        [introtext] => 
        [content] => <p>This is where the content appears</p>
        <img src= "http://localhost:8888/modx/assets/images/News/News_11_06_2012.jpg" width= "300"/>
        [richtext] => 1
        [template] => 0
        [menuindex] => 0
        [searchable] => 1
        [cacheable] => 1
        [createdby] => 1
        [createdon] => 2012-11-17 19:45:54
        [editedby] => 1
        [editedon] => 2012-11-27 12:35:48
        [deleted] => 
        [deletedon] => 0
        [deletedby] => 0
        [publishedon] => 0
        [publishedby] => 0
        [menutitle] => 
        [donthit] => 
        [privateweb] => 
        [privatemgr] => 
        [content_dispo] => 0
        [hidemenu] => 
        [class_key] => modDocument
        [context_key] => web
        [content_type] => 1
        [uri] => 
        [uri_override] => 0
        [hide_children_in_tree] => 0
        [show_in_tree] => 1
        [properties] => 
    )
    </pre>
    • discuss.answer
      • 33337
      • 3,975 Posts
      Please notice that the output is:

      <img src= "http://localhost:8888/modx/assets/images/News/News_11_06_2012.jpg" width= "300"/>
      

      You can change your image tv's output to "Default" so it doesn't output <img> tags. Then your output will be like below:

      http://localhost:8888/modx/assets/images/News/News_11_06_2012.jpg
      

      And your tpl will be working fine.
        Zaigham R - MODX Professional | Skype | Email | Twitter

        Digging the interwebs for #MODX gems and bringing it to you. modx.link
        • 36624
        • 535 Posts
        im wrong or there is no tv here. image is in the content ?! [[+content]] should be fine
          CTRL+SHIFT+U - Clear Cache
          CTRL+SHIFT+H - Hiding Heft Panel
          CTRL+SHIFT+N - Fast Create Resource
          CTRL+ALT+P - Preview Recource (in edit resorce window)
          CTRL+ALT+S - Save
        • discuss.answer
          • 14677
          • 54 Posts
          Quote from: emmanuel at Nov 29, 2012, 07:13 AM
          im wrong or there is no tv here. image is in the content ?! [[+content]] should be fine

          Looking at it, it is infact putting the image in the content area instead of a tv... Can you give us an example of your content out in your chunk?

          Should be something like [[+tv.content]]
          • discuss.answer
            • 36624
            • 535 Posts
            well well well.. we are close..

            You must assign the TV "news_thumb" to the template you use for the news !


            it's under "Template Access" in the Template Variable..

            Once you do that, go edit your news.. and you will see the TV.


            may be you should read this page to better understand all the power in TVs : http://rtfm.modx.com/display/revolution20/Creating+a+Template+Variable


            @jonrawlins tv.content huh? default fields (pagetitle,longtitle.. content) dont need prefix.. wink





              CTRL+SHIFT+U - Clear Cache
              CTRL+SHIFT+H - Hiding Heft Panel
              CTRL+SHIFT+N - Fast Create Resource
              CTRL+ALT+P - Preview Recource (in edit resorce window)
              CTRL+ALT+S - Save
              • 38175
              • 48 Posts
              Let me pivot just a bit. Assume that the url link to the image I want to get with getResource is in the content field of the child resource. How would I get the link to the image url without getting the rest of the text in the content field? Again, thanks to all for their help. The Modx community is the primary reason I have stuck with Modx since leaving Drupal.
              • discuss.answer
                • 36624
                • 535 Posts
                Quote from: scottmccullough at Dec 03, 2012, 12:44 PM
                Let me pivot just a bit. Assume that the url link to the image I want to get with getResource is in the content field of the child resource. How would I get the link to the image url without getting the rest of the text in the content field? Again, thanks to all for their help. The Modx community is the primary reason I have stuck with Modx since leaving Drupal.

                good question... but you can't have a part of the content field without using some extra code => in this case maybe i would use a js to extract the image src and hide the rest of html.. but this is bad.. and would do that only if i have 10k child to change.. wink

                Templates variables are here for this job : separate content in variable so you can reuse them individually in other part.

                enjoy your modx trip.

                (can you mark the post as solved if its ok?)
                  CTRL+SHIFT+U - Clear Cache
                  CTRL+SHIFT+H - Hiding Heft Panel
                  CTRL+SHIFT+N - Fast Create Resource
                  CTRL+ALT+P - Preview Recource (in edit resorce window)
                  CTRL+ALT+S - Save