ASPX templates
Version 6.x > ASPX templates > Adding custom field to a Page Menu Item View modes: 
User avatar
Member
Member
ovidiu-e-cubed - 11/9/2011 6:29:10 AM
   
Adding custom field to a Page Menu Item
Hi,

I want to add a global property to the site. Specifically, I have an image carousel which appears on all site pages. This is placed in the master page. I'm using ASPX templates.

I need to allow the Kentico CMS desk user to set the fad duration for the carousel (i.e. the time which has to elapses between fading two consecutive images in the carousel).

So I'm thinking of adding a property in the form tab of the Homepage.aspx page (which is based on an aspx page template). I can't seem to add this property.

Any Ideas on how I can achieve this?

User avatar
Member
Member
Luke - 11/9/2011 7:05:45 AM
   
RE:Adding custom field to a Page Menu Item
Hi,

It depends upon what doctype your Homepage.aspx page is, by default the root doctype does not allow custom fields however the Page (menu item) doctype does.

You could for simplicity assign Homepage.aspx a custom doctype with the settings you wish to be global and then in the masterpage pull back the document custom attributes (ie the fade time).

Another way and one that I have used myself is to create a xml document of config settings and then create a custom form in SiteManager that gets and sets the xml config values. That way you can also cache the xml config across all pages to avoid multiple hits on the database server as fade duration is unlikely to be changed often I assume.

Hope that helps,

Best Wishes,
Luke

User avatar
Member
Member
ovidiu-e-cubed - 11/9/2011 7:16:59 AM
   
RE:Adding custom field to a Page Menu Item
Hi Luke,

Thanks for the suggestions. I think I'll go with the first option, to allow the CMS user easier access to this (and upcoming) properties.

Question: How do I change the doctype for the Page (Menu item)? I created a new document type and added the Duration custom field.

User avatar
Member
Member
ovidiu-e-cubed - 11/9/2011 7:29:27 AM
   
RE:Adding custom field to a Page Menu Item
OK, solved.

When you right-click on the root to add a page, you have to select the new doc type you added instead of the "page menu item" option. After the actual page is created, you have to go to the Properties tab of the new page, select Template and choose the ASPX template you want to use.

User avatar
Member
Member
Luke - 11/9/2011 8:21:34 AM
   
RE:Adding custom field to a Page Menu Item
Precisely couldn't have put it better myself, glad you have solved your issue :-)

User avatar
Member
Member
Luke - 11/9/2011 8:24:15 AM
   
RE:Adding custom field to a Page Menu Item
For future reference you can also force a doc type to use a certain template by default rather than having to go to the properties tab of each new page. In the sitemanager -> development -> document types you can select your template there and then any newly created pages of the doc type will use the set template :-)