Working
[[$tpl.Link.Item@Business]]
[[$tpl.Link.Item@Personal]]
[[getResources? &sortby=`menuindex` &sortdir=`asc` &includeContent=`1` &depth=`0` &showUnpublished=`0` &tpl=`tpl.Link.Item` &includeTVs=`1` ]]
Not Working
[[getResources? &sortby=`menuindex` &sortdir=`asc` &includeContent=`1` &depth=`0` &showUnpublished=`0` &tpl=`tpl.Link.Item@Business` &includeTVs=`1` ]]
[[getResources? &sortby=`menuindex` &sortdir=`asc` &includeContent=`1` &depth=`0` &showUnpublished=`0` &tpl=`tpl.Link.Item@Personal` &includeTVs=`1` ]]
Or is their another way to skin this cat? I just want to be able to re-use link tpl.
DropboxUploader -- Upload files to a Dropbox account.
DIG -- Dynamic Image Generator
gus -- Google URL Shortener
makeQR -- Uses google chart api to make QR codes.
MODxTweeter -- Update your twitter status on publish.
discuss.answer
I don't think getResources is smart enough to parse those tpl properties. I think it's probably looking for (and not finding) a chunk called tpl.Link.Item@Business. Offhand, I can't think of any way around this short of rewriting the getResources code.
Quote from: BobRay at Mar 17, 2015, 02:57 AMI don't think getResources is smart enough to parse those tpl properties. I think it's probably looking for (and not finding) a chunk called tpl.Link.Item@Business. Offhand, I can't think of any way around this short of rewriting the getResources code.
Tell Jason to get on it then!
I was trying to workaround have two very similar tpl chunks or using a TV, since all the children of "Business" will have one link and all the children of "Personal" will have another.
DropboxUploader -- Upload files to a Dropbox account.
DIG -- Dynamic Image Generator
gus -- Google URL Shortener
makeQR -- Uses google chart api to make QR codes.
MODxTweeter -- Update your twitter status on publish.
-
☆ A M B ☆
- 24,524 Posts
You could use output modifiers in the tpl chunk based on the [[+parent]] value.
Quote from: sottwell at Mar 17, 2015, 12:45 PMYou could use output modifiers in the tpl chunk based on the [[+parent]] value.
Yep! That's what I did.
[[+parent:is=`283`:then=`[[+newBusiness]]`:else=`[[+newPersonal]]`]]
Thanks for the validation, good to know I came up with the same solution as you.
DropboxUploader -- Upload files to a Dropbox account.
DIG -- Dynamic Image Generator
gus -- Google URL Shortener
makeQR -- Uses google chart api to make QR codes.
MODxTweeter -- Update your twitter status on publish.
Quote from: bwente at Mar 17, 2015, 08:03 AM
I was trying to workaround have two very similar tpl chunks or using a TV, since all the children of "Business" will have one link and all the children of "Personal" will have another.
If I'm understanding you, it sounds like a good case for an @INHERIT TV.