More in this section

Forums / General Discussions / Adding Properties to Pages

Adding Properties to Pages

5 posts, 0 answered
  1. mattshepherd
    mattshepherd avatar
    5 posts
    Registered:
    25 Mar 2007
    02 Mar 2011
    Link to this post
    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
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    08 Mar 2011
    Link to this post
    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
  3. mattshepherd
    mattshepherd avatar
    5 posts
    Registered:
    25 Mar 2007
    21 Mar 2011
    Link to this post
    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
  4. Phill Hodgkinson
    Phill Hodgkinson avatar
    362 posts
    Registered:
    10 Nov 2004
    15 Jul 2011
    Link to this post
    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
  5. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    20 Jul 2011
    Link to this post
    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
5 posts, 0 answered