Universal Viewer with custom query

Sam Power asked on September 2, 2014 02:25

Hi there,

In many of the Kentico sites I build I often use a Universal Viewer with a Hierarchical transformation to display a list of nicely styled document type transformations. Using this approach allows me to keep the styling throughout the website consistent. Normally I would set the path of my uni viewer to documents sitting directly underneath the current page in the document tree.

What I want to do is have a page which checks the query string and based on this query string finds the document with a matching name to the query string value and uses the documents under this document in the universal viewer.

It looks like the universal viewer with custom query may be able to help me achieve this. So I have a couple of questions.

  1. Can I access query string values in a custom query?
  2. Can custom queries check the parents of documents in the document tree? Or even parents of parents?
  3. Do I need to write custom queries for all of the document types I want to have appear in the universal viewer?

Some example custom queries which achieve these things would be great.

If anyone has a better solution to this problem which doesn't use the Universal Viewer with custom query web part then I'm all ears.

Thanks, Sam

Recent Answers

Juraj Ondrus answered on December 6, 2014 10:16

Hi Sam,

In the query itself you can use macros like ##WHERE## and ##ORDERBY## - these are then replaced by the WHERE and ORDER By properties of the web part - and in these properties you can use query string macros. This should answer the first question.

For the second question - this depends on your custom query. You will need to create some complex query that will get the page value and us it in a sub-query to check the parent.

The third question - this depends what data you need from the pages and document types. I would check some of the views - like View_Tree_Joined if it contains the columns you need.

Best regards,
Juraj Ondrus

0 votesVote for this answer Mark as a Correct answer

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