Displayng datas with custom query repeater

Monjoie Dominique asked on April 28, 2015 12:47


I worked with Kentico since a few months and I still have a lot of things to learn but I have to put a site online in a few days, so my days are numbered.

I created two DocTypes : 'who' and 'what'. First table contains general datas about people and second one contains all the events organized by them.

I made a query to get the datas with a repeater with custom query. It works correctly and I obtain a result like this :

who1 - event1 (with some of the fields), who1 - event2, who1 - event3, who2 - event1, who3 - event1, who3 - event2, and so on ...

I'd like to realize different things : 1) to get a page like with on the top, unique datas from table who and below, all the datas linked to the item above. 2) I usually work with repeater and I use GetDocumentURL() to display datas via the 'Selected item transformation'. With the repeater with custom query, I have to create a new page and I wonder how to transmit the parameter to the page. I suppose it is something like ...page.aspx% who.name % but I don't know what do I have to write between the % for it works.

Sorry for my poor english.

All the best,

Correct Answer

Charles Matvchuk answered on April 29, 2015 01:03

I am not quite sure I am following you. You can use a where condition in the custom query and a macro to construct part of the where condition.

If I understand you correctly, for the event you want to have a relationship and save the Who Name. Basically if you are using the tree and putting the event under the who then you can always get the Who from the parent on the event by using {% Parent.DocumentName %} Also you can get any of the fields of the parent document by using {%Parent.YOURFIELDNAMEHERE %}. If you want to store this as a default value when you are creating the event, then you can use macro's or the OnAfterSave Event with custom code.

If I am not understanding your challenge correctly, please elaborate.

0 votesVote for this answer Unmark Correct answer

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