Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

MVC - Can I have properties in the _layout file?

Vote:
 

Can I have properties in the _Layout.cshtml file somehow?

The scenario I'm thinking of is to allow the editor to change the image file used as the logo for the site, a logo that resides within a layout file.

Since the layout is not part of a specific page, I'm not sure how I can bind properties to it?

#76228
Oct 21, 2013 14:31
Vote:
 

This is done is the alloy mvc templates. I would recommend that you take a look on how it is being done there.
http://world.episerver.com/Articles/Items/ASPNET-MVC-Templates-for-EPiServer-7-CMS/

 

The property is not on the layout view itself, but added on the start page. A edit hint connection is then added to make the property editable despite being in the layout view.

#76230
Oct 21, 2013 15:06
Vote:
 

Thanks Per for pointing that out.

Is there any documentation on edit hint? I don't understand what it is and how it works.

#76243
Oct 21, 2013 20:32
Vote:
 

In the SDK: Editing hints in MVC.

Frederik

#76245
Oct 21, 2013 21:23
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.