Hello, Im trying to figure out how to use a dropdown list (single selection) TV to control what TPL is used with a blogpost.
What I have is a simple blog setup, but blog posts are to be shown on the "Home page" with special formatting depending on the post type. So for example if the post type is "multimedia" it needs to use a different "rowTPL" than if the post type is "text".
I understand how to use getResources to output new blog posts on the frontpage but I'm unsure how to format the getResources call to retrieve the TV "post type" info and then choose the TPL based on that. Any help is sure appreciated!
EDIT: i have done some digging, and it appears that i can use getResources' "conditionalTPLs" property to acheive this
(i saw it in this thread
https://forums.modx.com/thread/77711/getresources---different-template-for-each-resource)
So i guess now that all i need to do now is figure the correct syntax for this property in my get resource call; that is how to get it to check for the tv value chosen, and then assign a specific TPL for each possible TV choice. will be trying whatever i can but any help would be great; Im still a little dumb to more advanced stuff like this. however if i figure it out i will be sure to post my solution.
EDIT 2: upon further research, the conditionalTpls property has to be a resource field and cannot be a TV. hmmm not quite sure how to pull this off as of now, there may be a different approach that needs to be taken.
[ed. note: wonderfulweb last edited this post 12 years, 5 months ago.]