Add page type references into another page type

Brian Ward asked on August 17, 2016 22:53

Hi all, I apologize as I'm sure this is clearly documented some place but I'm having trouble finding it.

I have a page type (products) that when a new entry form is displayed I want provide a set of checkboxes of a related page type (markets). Do I use the checkbox field type and just pull/display the data through a custom SQL query? There must be an easier way...

Thanks.

Recent Answers


Rui Wang answered on August 17, 2016 22:58 (last edited on August 17, 2016 23:10)

Hi Brian

Using SQL query to populate the list of value would be the simple way is you want to check them from a list in the page type. But it also depend on what's the outcome you want to get as well. Just display a list of markets or should the markets be links to other pages.

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on August 17, 2016 23:00 (last edited on August 17, 2016 23:01)

Couple of options

1: You can use the Document Categories, and make "Markets" a category instead. This way you can pull in products by markets through a simple SQL Query of

DocumentID in (select DocumentID from CMS_Document_Category where CategoryID = (Select top 1 CategoryID from CMS_Category where CategoryName = 'MarketABC'))

2: You can use a Multiple select checkbox form control, set the data source to "SQL Query" as you mentioned and do a query of "Select Name, CodeName from Content_Markets" or something similar.

3: There is also in the Page Properties tab (not on the form, but in the properties) a "Related Document" section that you can relate one document (product) to other documents (markets). (see here)

0 votesVote for this answer Mark as a Correct answer

Fabian Haeger answered on August 18, 2016 18:17

Are your markets in a fixed folder? Or are they spreaded around the Web?

If they are in a fixed folder, it's easy to make this via a macro-expression. See the attached screenshot for an Example. You definitly should make sure, that Content Editors aren't allowed to change the folder name, or move it to a drifferent place.

Image Text

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.