Columns content filter over multiple page types

Dennis Hulsmans asked on May 27, 2016 17:14

Hi

I'm having trouble selecting the correct fields over several page types. Page types have their own fields. For example ExtraLink. Another page type has a field ShowOnHomepage (the previous page type doesn't contain this field)

How can I use the columns content filter to get only the specific fields I want. Usually you limit the fields you need (performance tip), so I added following fields: DocumentUrlPath, NodeAliasPath, DocumentMenuItemInactive, DocumentName, MenuItemTeaserImage. Now I want to add the column ExtraLink from page type 1 and the showOnHomepage from page type 2.

Unfortunately this results in an error, because ExtraLink doesn't exist in my page type 2. If I remove ExtraLink , it still won't work because ShowOnHomepage doesn't exist in page type 1.

Can't I use something like we do in SQL?
SELECT m.ExtraLink, p.ShowOnHomepage FROM PageType1 m, PageType2 p

If I leave the Columns in the Content Filter empty, it does work, but then it will select 173 columns !!!

I'm running in circles atm, and I'm not sure if this is possible.

Thanks in advance!

D.

Recent Answers


Laura Frese answered on May 27, 2016 18:17 (last edited on May 27, 2016 18:23)

Have you tried writing a custom query?

Then you can use a repeater with custom query to display the data.
https://docs.kentico.com/display/K81/Loading+data+using+custom+queries

2 votesVote for this answer Mark as a Correct answer

Anton Grekhovodov answered on May 27, 2016 20:12

Hi Dennis, Is it necessary to union two different page types in one datasource? I think you will have troubles in a transformation too.

Anyway, the best way was mentioned by Laura. Or you can add ShowOnHomepage to the first page type, ExtraLink to the second and hide them in UI.

1 votesVote for this answer Mark as a Correct answer

Dennis Hulsmans answered on May 28, 2016 08:41

Hi Anton

The reason I have 2 different page types is because it's a menu (hierarchical viewer), with products. I'm trying to create fields that I can use to create call-to-action buttons in my menu

1 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on May 28, 2016 18:20

If it's for a menu use the standard fields for displaying the data, unless you specifically need those custom fields. For example, instead of using MenuItemName use DocumentName because that field is the same across all page types, in 99% of the instances I've come across.

If your using a hierarchical or universal viewer, a simple fix (hack) I've done is to simply add the same fields to the other page types but don't show them on the form. This will satisfy your query and still achieve what you need.

1 votesVote for this answer Mark as a Correct answer

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