Databinding at Separator

John Fu asked on October 8, 2015 09:17

Is it possible to get data from the node at the specified level within separator transformations? I keep getting blanks.

Thanks.

Recent Answers


Brenden Kehren answered on October 8, 2015 14:03

The separator does not have a DataView associated with it, so the answer is no. Add the separator in your item transformation and then add a last item transformation with everything your item transformation has but remove the separator.

0 votesVote for this answer Mark as a Correct answer

John Fu answered on October 8, 2015 23:12 (last edited on October 9, 2015 00:36)

Hi Brenden, Thanks. My issue is that I'm trying to print a field from the parent node after the last child has printed. Eg

PARENTNODE
    CHILD
    CHILD
    CHILD
    BUTTON WITH PARENT NODE FIELD
CLOSE PARENT NODE

REPEAT THE ABOVE MULTIPLE TIMES.....

hope that made sense.

I also tried in my parent level transformation, put in <cms:SubLevelPlaceHolder runat="server" ID="plcSub" /> as per the documentation, but when rendered, it says unknown server tag cms:SubLevelPlaceHolder. Any ideas?

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on October 12, 2015 17:50

The cms:SubLevelPlaceHolder is not available in v7. To do this, it would be easiest to create a custom transformation method that will achieve what you're looking for. It might look like this if you were to do it inline:

DocumentHelper.GetDocument(ValidationHelper.GetInteger(Eval("NodeParentID"), 0), "en-US", new TreeProvider()).GetStringValue("ColumnName", "")

Of course if you have a multi-lingual site you'll want to make the language be dynamic.

Also check out Kentico MVP, Ilish Mistry's post on Hierarchial Viewers (and extension) in v7 for a mega menu. http://www.mmtdigital.co.uk/ilesh-mistry/blog/version-7-hierarchical-viewer-mega-navigation-with-extension-example

0 votesVote for this answer Mark as a Correct answer

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