Adding Properties to Pages
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
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.
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
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;
Hi Phill Hodgkinson,
I have answered you in the support ticket you have opened.
Kind regards,
Victor Velev
the Telerik team