We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 45479
    • 18 Posts
    Awesome, now I got it. I thought I had to create a special resource with some kind of values for this ... thanks a lot Ben, made my day!
      • 45479
      • 18 Posts
      Quote from: opengeek at Oct 31, 2013, 12:22 PM
      You need the tplCondition to be the name of the field whose value you want to compare to the keys in your conditionalTpls. These are the same fields you would use in the sortby, or in field tags, e.g. [[*pagetitle]].

      In your case you want the tplCondition to be template.

      Now I got it even better. Some comparable value where those two (in my case) differ. "parent" fits perfectly, while "template" doesn't do the trick, but that is due to my setup but "template" would work aswell. Thanks a lot for the additional explanation!
        • 45479
        • 18 Posts
        Quote from: bennyb at Oct 31, 2013, 12:09 PM
        @rotter. Also how different do hs-news and hs-outlet differ? As you could just use some output filters.

        That would have been my second choice. But it's hard to beat those two lines. wink
        &tplCondition=`parent`
        &conditionalTpls=`{"XX":"hs-news","XX":"hs-outlet"}`
          • 36926
          • 701 Posts
          Quote from: rotter at Oct 31, 2013, 12:55 PM
          Quote from: bennyb at Oct 31, 2013, 12:09 PM
          @rotter. Also how different do hs-news and hs-outlet differ? As you could just use some output filters.

          That would have been my second choice. But it's hard to beat those two lines. wink
          &tplCondition=`parent`
          &conditionalTpls=`{"XX":"hs-news","XX":"hs-outlet"}`

          Glad you got it working.
            • 41294
            • 34 Posts
            Conditional TPL is great feature added to getResources, but could be more awesome if only it allows Template Variable. I've seen the documentation that says "Defines a field of the resource to evaluate against keys defined in the &conditionalTpls property. Must be a resource field; does not work with Template Variables.". But what i want is for the user to select a layout for each resources, and i can define the chunk for the layout selected as below:

            &tplCondition=`TVName`
            &conditionalTpls=`{"1":"layout-1","2":"layout-2","3":"layout-3"}`


            Hope it will be added soon. Great Work! smiley