How to create a template with temporarily no content?

Jan 12, 2015 at 9:26 PM
Well, the question may sounds a little odd but has a relevant scenario. The customer would like to have the possibility to make a temporary announcement/topicality on his start page like Company holidays for example in a own template.

The very first time as usual 2sic provides a message (no content yet, add one) and a link to enter content.
But after deleting this single entity the customer is no longer able to enter another one later on.
From the edit dropdown of the module there are only the change template- and adminoption left.

Is this a bug?
Whats a way to solve this scenario?

many thx for your answers

greetz collective
Coordinator
Jan 13, 2015 at 8:04 AM
Hi Collective

This shouldn't be an issue. there are at least 5 ways to do it, here's a simple one (assuming you use Razor for your templates)
  • Enhance your content type to have a "show" boolean field
  • make your template respect that with a @if(Content.Show) { } statement
Now your customer doesn't need to delete the item, all he does is set show to false and true again.

Good luck :)
Marked as answer by Collective on 1/13/2015 at 1:55 AM
Jan 13, 2015 at 9:55 AM
Simple and elegant solution. Thank you very much.

collective