Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Dynamic content and "advanced" output


I have a challenge. It's like a footnote in the text which will be a link to a comment further down on the page. I want to create dynamic content that handles this. Add new comment -> Insert footnotenumber -> insert comment..

Output: Footnumber (with link to comment) where the dynamic content is inserted. And in the bottom of the page, Comments (all). See example in bottom.

I think there is a way to override a method that writes out the fragments.

This is an example<sub>1</sub>
blah blah blah
blah blah blah
blah blah blah<sub>2</sub>


List of comments/footnotes:
Comment/footnote1: Example is a blaha blah
Comment/footnote2: ...

Nov 18, 2008 9:33

To me that doesn't seem like a good candidate for Dynamic Content since it needs to be inserted at separate points and the inserted content as you describe it doesn't seem dynamic!

However I think it should be a better match for a regular Editor plugin. There should be documentation on this site on how to create such a plugin.Please post back if you need some more pointers for this.


Nov 18, 2008 10:52

Thank you. I see your point. Yes, if you have some pointers, please :)

- Roar

Nov 18, 2008 13:29


I tend to disagre with Henrik. Dynamic content will be a good method of inserting comments marks and adding text bellow.

Have made some code that actully does this :)

The Comment class is the dynamic content implementation. This class will return a CommentControl that will check the parent control collection and find what number the comment is. It will also add the actully comment to the parent control collecction.

The best part is that this code dosnt need any other stuff. It will just manipulate the parent's control collection

Nov 18, 2008 22:48

You are right Anders, that was a pretty clean solution. :)

Can't really be sure what the parent is always though...

Nov 19, 2008 2:26


i have been thinking about contextes the parent would be null, but i cant think about any times this will occure. but some error handling would of course be an improvment to the codeSmile

Nov 19, 2008 8:42

I agree with H.N. (first post) that this is not dynamic content. But I believe Dynamic Content is a nice way to do it, at least compared to how it is done today. Thank you both for your contributions, and especially Anders for his code contribution! Cool


Nov 20, 2008 8:47

I faiil to see why this isnt a good why of using dynamic content. The dynamic part of this is the numbering of the comments.

If you want to make a editor plugin you have to store the points where the comments are placed inside the text, and you have to make a new property too render the content and place the comment text bellow the text.

That is 2 places you have to make a change.

Nov 20, 2008 10:12

I think this is a good candidate for DynamicContent (DC).

Scatter DC comment instances around your text, and when you render each one, add it to a comment collection in the HttpContext.Current.Items collection, so each comment will get is number in the collection (which you also use as a reference in the text.)

When you get to the bottom, just iterate over the comment collection from the HttpContext.Current.Items["MyProp_Comments"] propert (which you of course have to create and handle.)

This will give you two nice features:

1. Each comment can be edited separately in the DC popup, and you can even add more information about the comment.

2. You can insert new comments anywhere in the text, and all comments will be automatically re-numbered (as the number is not determined before the whole thing is rendered.)

You could optionally add the comment renderer (the one at the bottom) as it's own DC, and not part of the page.


Nov 24, 2008 9:50

One problem with that solution is that the editor have to remeber to add the last DC. But the cool thing about it is that the count will be uniqe on the page so 2 properties mainbody and manbody2 would not share the comment number.

Maybe you could combine Steve's method and mine


Edited, Nov 24, 2008 10:03
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.