Hello there.
How can i query the DB in order to extract multiple tpl variables for 1 resource?
i mean, as you already know, THE TABLE modx_site_content contains pagetitle and content in this table.
THE TABLE modx_site_tmplvar_contentvalues contains the tplvars a user created for different purposes: it contains as columns
contentid(which refers to the id in modx_site_content) and
value(which contains the value of, for example, image-description, image and SEO-Title)
modx_site_content
-----------------------------------------------------------
id | pagetitle | content
-----------------------------------------------------------
1 article 1 this is the content1...
2 article 2 this is the content2...
modx_site_tmplvar_contentvalues
-------------------------------------------------------------
tmplvarid | contentid | value
-------------------------------------------------------------
1 1 path-to-image1.jpg
2 1 description for image1
3 1 SEO title for article 1
1 2 path-to-image2.jpg
2 2 description for image2
3 2 SEO title for article 2
i would like this result:
pagetitle | content | image(it contains the url) | image-description | SEO-Title
----------------------------------------------------------------------------------------------------------------
article 1 | this is the content1... | path-to-image.jpg | description for image1 | SEO title for article 1
article 2 | this is the content2... | path-to-image2.jpg | description for image2 | SEO title for article 2
Thanks and would appreciate your help
sorry, file attachment(table-ok.jpg) ifs for the table(screenshot)
[ed. note: jacielluve last edited this post 6 years, 1 month ago.]