Try our conversational search powered by Generative AI!

Saving variables from admin plugin


I'm trying to do a plugin to the admin mode were only the admin can change one thing on the site. I have been asking around but no one seems to know how to save a variable from the admin mode or to access it.

I want the admin to be able to change the text in the footer of the masterpage but not the editors.

Can someone push me in the right direction? I'm new at EPiServer so please keep any explanation quite simple.

Feb 18, 2010 8:31

With a variable you mean a episerver page property?, or are you thinking about dynamic properties?

Feb 18, 2010 9:33

If you are looking for ways of saving dynamic properties, some of these lines can be used

DynamicPropertyCollection dynamicTarget = DynamicProperty.ListForPage(p2.PageLink);
DynamicPropertyCollection dynamic = new DynamicPropertyCollection();
dynamicTarget[key].PropertyValue.Value =!newValue
DynamicProperty.SaveCollection(p2.PageLink, dynamic);

Feb 18, 2010 9:37

I just needed to save value and be able to access it from the Masterpage. I found a good way now. The PlugInSettings class contained a function called Save and Populate which both work really well.

Thanks for the help anyway!

Feb 18, 2010 10:32

Hi Adam,

I'd make a new tab in admin mode for that. You can then set "Requires Access Level" to "Administer" and put an ordinary dynamic string property under that tab. That way, only administrators can access the tab and change the value.

Feb 18, 2010 10:53
* 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.