We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 44968
    • 1 Posts
    Hi all,
    I'm new at modX Revo and have an problem with the "toPlaceholder" function. First of all please excuse my bad english im not a native speker.
    What i want to do:
    Create a resource "footer" that is available in all other templates, so i can edit it from the resource tab
    How I tried to do it
    I created a template "footer" and linked it with the tvs I needed. Then I created a footer chunk and placed my HTML inside of it. In the other templates i used the function:
    [ [!getResources? &resources=`10` &includeContent=`1` &includeTVs=`1` &tpl=`tpl_footer`] ]

    and could use my tvs in the chunk (for example: [ [+tv.footer_box_title_1] ]). This works perfect.
    The problem
    I try to execute this function inside the chunk: tpl_footer
    [ [!getResources? &resources=`10` &includeContent=`1` &includeTVs=`1` &toPlaceholder=`cnt`] ]

    If I call it ([ [+cnt] ]) I get this array:
    Array
    (
        [tpl] => 
        [tplOdd] => 
        [tplFirst] => 
        [tplLast] => 
        [tplWrapper] => 
        [wrapIfEmpty] => 
        [sortby] => publishedon
        [sortbyTV] => 
        [sortbyTVType] => string
        [sortbyAlias] => 
        [sortbyEscaped] => 0
        [sortdir] => DESC
        [sortdirTV] => DESC
        [limit] => 5
        [offset] => 0
        [tvFilters] => 
        [tvFiltersAndDelimiter] => ,
        [tvFiltersOrDelimiter] => ||
        [depth] => 10
        [parents] => 
        [includeContent] => 1
        [includeTVs] => 1
        [includeTVList] => 
        [showHidden] => 
        [showUnpublished] => 
        [showDeleted] => 
        [resources] => 10
        [processTVs] => 
        [processTVList] => 
        [prepareTVs] => 1
        [prepareTVList] => 
        [tvPrefix] => tv.
        [idx] => 1
        [first] => 1
        [last] => 1
        [toPlaceholder] => cnt
        [toSeparatePlaceholders] => 
        [debug] => 
        [where] => 
        [dbCacheFlag] => 0
        [context] => 
        [tplCondition] => 
        [tplOperator] => ==
        [conditionalTpls] => 
        [odd] => 1
        [id] => 10
        [type] => document
        [contentType] => text/html
        [pagetitle] => Footer
        [longtitle] => 
        [description] => 
        [alias] => 
        [link_attributes] => 
        [published] => 1
        [pub_date] => 0
        [unpub_date] => 0
        [parent] => 0
        [isfolder] => 
        [introtext] => 
        [content] => 
        [richtext] => 1
        [template] => 8
        [menuindex] => 5
        [searchable] => 1
        [cacheable] => 1
        [createdby] => 1
        [createdon] => 2013-08-31 14:31:11
        [editedby] => 1
        [editedon] => 2013-08-31 20:46:47
        [deleted] => 
        [deletedon] => 0
        [deletedby] => 0
        [publishedon] => 2013-08-31 14:33:00
        [publishedby] => 1
        [menutitle] => 
        [donthit] => 
        [privateweb] => 
        [privatemgr] => 
        [content_dispo] => 0
        [hidemenu] => 1
        [class_key] => modSymLink
        [context_key] => web
        [content_type] => 1
        [uri] => 
        [uri_override] => 0
        [hide_children_in_tree] => 0
        [show_in_tree] => 1
        [properties] => 
        [tv.footer_box_title_1] => Anschrift
        [tv.footer_box_1] => 
    
    Bürotec
    Inh. Thomas Hillmeyer
    Visbecker Str. 2
    27793 Wildeshausen
    Tel.: 04431 / 92 36-0
    Fax: 04431 / 92 36-2
    
        [tv.footer_box_title_2] => Aktueller Flyer
        [tv.footer_box_2_2] => assets/files/pdf/Bewerbung.pdf
        [tv.footer_box_2_1] => Lorem ipsum dolor sit amet, consectetur adipisicing elit. Asperiores autem dolores, eligendi esse excepturi exercitationem.
        [tv.footer_box_title_3] => Kaufberatung und Support
    )

    but if I try to get just one value
    [ [+cnt.tv.footer_box_1] ]

    it returns nothing.
    Can you tell me what I am doing wrong?
      • 42046
      • 436 Posts
      You need to specify &tpl in a getResources call otherwise it will output an array.

      [[!getResources? &resources=`10` &includeContent=`1` &includeTVs=`1` &toPlaceholder=`cnt` &tpl=`yourTpl`]]
      [ed. note: absent42 last edited this post 13 years, 1 month ago.]