Using Rules & Profiles To Drive Custom Pages
By Kyle Hatlestad on Jan 20, 2010
One of the great features of UCM is the ability to create dynamically rendered pages and be able to simply check them in to have them work. These include the Hypertext Content Server Template (HCST), Hypertext Content Server Page (HCSP), and Hypertext Content Server Form (HCSF). Each one is a combination of HTML and IdocScript for server-side rendering. The HCSFs are meant for on-line form data entry (which in-turn create HCSPs with that data embedded). And HCSTs and HCSPs are meant as more general display pages. The main difference between them being HCSPs are indexed (and thus need the <!--$ --> Idoc syntax) and HCSTs are not.
With these dynamic pages, you can go so far as to create your own custom check-in, search, and content information page. And what's nice is that you don't need a full-blown component to do it. You simply create your file, check it in, and then clicking on the web location will execute and display it.
I would definitely recommend checking out Bex's The Definitive Guide to Stellent Content Server Development book for great examples on how to create your own custom pages.
But let's say you have a custom Search or Info page and you want to incorporate it into the standard pages in UCM. So at that point do you need to create a custom component that will modify the services or navigation so that the custom page is used instead? Do you need to overwrite all the places that the standard page is used to use the custom page instead? With a few tweaks to your Rules and Profiles, you don't have to.
So what you want to do is create a Rule that will include a Side Effect which will incorporate the custom page.
- Check in your custom page and copy the web location.
- In the Configuration Manager applet, create a new Rule.
- Turn on the 'Use rule activation condition' and click the Edit... button.
- Depending on what type of custom page you are defining, you may want to create a condition to only activate on that particular action. In my example, it's on the 'Content information' action.
- Click on the Side Effects tab and enter the Key and value of:
Value: (relative path to your custom page) (e.g. /idc/groups/public/documents/document/he000744.hcst)
- Include that Rule in a particular Profile or make it Global
By passing in the 'urlTemplate' parameter, that tells Content Server to use that particular page instead of the standard template for display.
So because it's executed in the Rule/Profile, there is no need to modify the standard links and navigation to use it.
Special thanks to Ed Bryant for sending me this tip!