1

I need a feature in EPiServer 7 where I can enter a temporary message that will be shown at the top of the page on the site, for example "Support number is currently down..." if there is a problem with the support number so that everyone can see this. When the problem is solved i go in and remove it.

Is there a feature like this that I can use or how should this be done?

  • Why not add a string property to write your message and a boolean property to show/hide the first one? You will see those properties in all the pages with the same type (ofcourse after you add them in your code) and this way you can even write different messages to different pages (if you want to) and choose to show or hide them. by default i would not show them but only when needed. – photowalker May 08 '14 at 06:22

1 Answers1

1

I would add a "site message" property to the Start Page. You can the load the start page on all other pages and display the message. EPiServer does a good job of caching PageData so loading this page won't cause much of an overhead.

E.g.

class StartPageData : PageData
{
    // Could easily be a ContentArea or other type
    public virtual string SiteMessage { get; set; }
}


// In you masterpage or some other suitable place
var startPage = DataFactory.Instance.Get<StartPageData>(PageReference.StartPage);
var siteMessage = startPage.SiteMessage;
// display siteMessage
Greg B
  • 14,597
  • 18
  • 87
  • 141