Adding Properties to Pages

Posted by Community Admin on 03-Aug-2018 15:19

Adding Properties to Pages

All Replies

Posted by Community Admin on 02-Mar-2011 00:00

Hi All,

I am using my own masterpages as a base for sitefinity templates (not sure if this is relevant but cant hurt).. I want to give the editor the ability to specify page level properties, so for instance, specify a string value which is used within the masterpage but set on each inheriting page. 

Id also  like to go a little further and use other input types, like image select etc..

Any advice or direction would be very much appreciated.

Cheers,
Matt

Posted by Community Admin on 08-Mar-2011 00:00

Hello Mattshepherd,

 
We support custom fields for pages in API level only, which means that you should define them through code and then extend the templates in the backend. I think this will take too much time though, for a task like this.

That's way I think you may go with another way - instead of defining fields in the pages, is it an options to add new meta tags in the page html? This way, you will have access to this metatag in the controls you place on the pages. 

Let me know exactly what are you trying to achieve and why, and perhaps we may be able to find better solutions. 

Greetings,
Georgi
the Telerik team

Posted by Community Admin on 21-Mar-2011 00:00

Hi,

I have a CMS page which calls data from an external source via a WebService.  I was hoping to allow an editor the ability to specify an ID on given page for the WS call to use.

I solved this by creating a new control and exposing properties on that to the editor.  I then reference these from within the template.  Not ideal, but does the trick.

Cheers,
Matt

Posted by Community Admin on 15-Jul-2011 00:00

Hi Georgi,

I'm trying to use the solution you suggested of adding custom meta tags to the page. However when I try to access them from a user control (widget) that I've dropped on the page the meta tags don't seem to exist. Can you let me know how you were able to do this or is it possible that it was just a suggestion and not a tested solution that actually works?

The following is the code I have tried to use in both PageLoad and in ItemDataBound of repeater in my control, neither place is able to find any HtmlMeta objects in the header.

// Get Category
List<HtmlMeta> metas = new List<HtmlMeta>();
foreach (Control c in this.Page.Header.Controls)
    if (c.GetType() == typeof(HtmlMeta))
    
        HtmlMeta meta = (HtmlMeta)c;
 
        if (meta.Name == "CategoryColor")
            categoryColor = meta.Content;
    


Regards,
Phill

Posted by Community Admin on 20-Jul-2011 00:00

Hi Phill Hodgkinson,

I have answered you in the support ticket you have opened.

Kind regards,
Victor Velev
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed