Allow end users create page and define its metadata easily

   —   
In this article you find out how to give your end (live site) users possibility to not only create content on your Kentico CMS based web site, but on top of that enrich functionality by allowing them to specify a metadata information related to the page being created.

In this example we're going to use the capabilities of a field editor. The field editor is an administration interface you can find in the Site Manager-> Development-> Document types -> -> Edit-> Fields tab. It can be also found in the BizForm module where you define the form fields and it's highly possible the same control will be used in the future whenever new module will be added into Kentico CMS.

Let's assume you're using the User contributions module of Kentico CMS on your live site and that way you allow users to contribute to your web site. You have placed contribution list on your page and configured it to display all the pages (menu item). User can therefore edit an existing one or create a new page from scratch. By default the keywords couldn't be specified by user. Let's change it.

Go to the Site manager-> Development-> Document types-> Page (menu item)-> Edit. On the 'Fields' tab use the 'New system attribute' button to add new system field.

1_Field_editor_systemFields.png

Select the 'Document attributes' group and the 'DocumentPageKeyWords' in the 'Attribute name'. Make sure the 'Display attribute in the editing form' is checked. Specify the 'Field caption' value and select the 'Field type' control. Confirm your changes.

2_System_field.png
Go to the live site and bring up the page containing the contribution list. Edit some page.



You should get displayed by an editing form containing the 'Key words' field included. Enter the required key words within and save the changes.

4_Keywords_live_site.png

When you navigate to the page modified recently, the updated version should contain the key words inside the HEAD element of the page. Check it by reviewing the HTML source of the page.

5_keywords_HTML_source.png

-kj-


See also: Macro expressions available for document metadata properties

Applies to: 4.x, 5.x
Share this article on   LinkedIn

Karol Jarkovsky

Director of Product

Comments