How to add a custom classification on a page to display as a

Posted by geoff.white@dsr.wa.gov.au on 23-Aug-2019 06:14

A have three custom classifications (AGLS terms) that I want to be able to select per page and for those classifications selected be displayed as a metatag for that page.

I can add a custom field on the page which allows me to select the tags, but how do I automatically apply this as a custom metatag in the template?

E.g. the meta added in the HTML of the page:

<meta name="AGLSTERMS.documentType" scheme="AGLSTERMS.agls-document" content="<inserted tags as selected per page here>" />

Progress Sitefinity CMS 11.2 Online Marketing Edition 
Build version:11.2.6900.0             

<meta name="AGLSTERMS.documentType" scheme="AGLSTERMS.agls-document" content="policy statement" />

All Replies

Posted by geoff.white@dsr.wa.gov.au on 29-Jan-2020 04:28

Any ideas?

Posted by jread on 29-Jan-2020 13:14

Here is some code that will get you most of the way.  You will need to modify it to get scheme attribute in there. The OnPagePreRenderCompleteEventHandler(IPagePreRenderCompleteEvent evt) will be called on each page render then look for the fields on the page to add the value as a metafield.  To register the page render event you can do it in your Global.asax or in a separate assembly.  

Sitefinity docs reference for events www.progress.com/.../for-developers-pages-events

Code:

gist.github.com/.../4f9e903741c385567f85f87456484b91

This thread is closed