I have multiple product pages (same page template), and each page is supposed to have different sales rep contacts on the sidebar. I set up the sidebar contact box as a repeater to pull data/filter data from a SalesRep
page type. The SalesRep
page type has a field called ContactForPage
; and my plan is to put in a string from the product page URL, so that if the string match the page URL, the contact will be displayed on the sidebar for that page.
Example: Current page url is: www.domain.com/products/product-123
John Doe has ContactForPage
= product-abc
Jane Doe has ContactForPage
= product-123
Jane Doe will be displayed as contact because the field value matched part of the URL.
I've been trying to write the WHERE statement but don't really know the syntax. Could you help!
Something like: WHERE: SalesRep.ContactForPage LIKE '%CurrentDocument.NodeAliasPath%'
Fist of all using URL as in SQL query is not a good idea. You have to define relation between sales reps and products correctly. Probably one sales reps might be selling TV, the other - cellphones. But if you want to directly connect product to sales man. You can use Related Pages and relationship structure.