Question

I am working on an EPiServer 5 project and I need to fill in the meta-description property of my page type with data from other properties. E.g. Take the first sentence of the body and use it as meta description"

This should be done if the editor left the meta description empty. Any help on how to solve this issue?

Many thanks.

Was it helpful?

Solution

There is a code example how to fallback and extract text from your main body in the example project PublicTemplates (or Alloy demo site for EPiServer 6 R2 and later) that ships with EPiServer. Look at the Header.ascx.cs file.

OTHER TIPS

Connect to the DataFactory PageSave event and change the value before it is saved.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top