Pergunta

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.

Foi útil?

Solução

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.

Outras dicas

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top