News ticker sharing content across all site pages.
I have a news ticker in my site master template, what I want is the content editors to be able to edit the content of the news ticker without risking breaking the master template.
I have thought about including a property as a composition in the content template but this would mean that the content editors would need to enter the news ticker on every page.
Is there a way to link a newsticker content page into the master template, so that the content editors only have to edit the content in the page to effect every page within the site.
Would you be able to explain a bit more please, I'm not 100% sure I understand what you are asking for.
Currently, my understanding is that in your master template (cshtml file?) you are trying to render out a news ticker so that it shows on all pages. However, you believe that you currently have to configure this on the template for all other document types so it will render?
If that is correct, you could just have the news ticker on your Home Page document type (assuming under the content section you create a Home Page as your first node and everything else sits underneath it), you could then use something like this in your template to get the content for your ticker:
var tickerContent = Model.Content.Site.GetPropertyValue("myTickerProperty");
This would, in your master template, allow you on any page to get the highest level node and retrieve a property off of it.
It works on the assumption that under the Content section your tree looks something like this:
No problem at all Brian, that's what this community is all about :-) Pleased you got it working.
It would be great if you could flag the appropriate response as the solution to your issue so that if others come along with a similar issue they can see what helped you :-)
News ticker sharing content across all site pages.
I have a news ticker in my site master template, what I want is the content editors to be able to edit the content of the news ticker without risking breaking the master template. I have thought about including a property as a composition in the content template but this would mean that the content editors would need to enter the news ticker on every page. Is there a way to link a newsticker content page into the master template, so that the content editors only have to edit the content in the page to effect every page within the site.
Hi Brian,
Would you be able to explain a bit more please, I'm not 100% sure I understand what you are asking for.
Currently, my understanding is that in your master template (cshtml file?) you are trying to render out a news ticker so that it shows on all pages. However, you believe that you currently have to configure this on the template for all other document types so it will render?
If that is correct, you could just have the news ticker on your Home Page document type (assuming under the content section you create a Home Page as your first node and everything else sits underneath it), you could then use something like this in your template to get the content for your ticker:
This would, in your master template, allow you on any page to get the highest level node and retrieve a property off of it.
It works on the assumption that under the Content section your tree looks something like this:
Hi thanks for the reply, with your pointer I've now managed to get what I want, I've now got the news ticker content as a property in the home page.
No problem at all Brian, that's what this community is all about :-) Pleased you got it working.
It would be great if you could flag the appropriate response as the solution to your issue so that if others come along with a similar issue they can see what helped you :-)
is working on a reply...