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

Try our conversational search powered by Generative AI!

Saving variables from admin plugin

Vote:
 

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.

Example:
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.

#37041
Feb 18, 2010 8:31
Vote:
 

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

#37043
Feb 18, 2010 9:33
Vote:
 

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
dynamic.Add(dynamicTarget[key]);
DynamicProperty.SaveCollection(p2.PageLink, dynamic);

#37044
Feb 18, 2010 9:37
Vote:
 

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!

#37045
Feb 18, 2010 10:32
Vote:
 

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.

#37049
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.