Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Rewrite meta description using macro View modes: 
User avatar
Member
Member
eric.savage-clyral - 9/26/2012 7:34:22 AM
   
Rewrite meta description using macro
On the document type, I am taking advantage of the DocumentPageDescription and I am inserting a macro with {% Description %} to copy the value from the Description field. I am keep display attribute in editing form unchecked.

However, this attribute seems to have no effect on the meta-data when I view the page. It looks like the meta-data section in the CMS Desk is king and nothing else is recognised. Any ideas?

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 9/26/2012 8:26:22 AM
   
RE:Rewrite meta description using macro
Hello,


if I understand:

you add the {% Description %} macro to document Properties -> Metadata, right?

"Description" is a document type field which is marked as hidden on the editing form, right?

What version of Kentico CMS do you use exactly (hotfix or build number)? I am testing the scenario and it adds the correct text to the Description meta tag.


Best regards,
Helena Grulichova


User avatar
Member
Member
eric.savage-clyral - 9/26/2012 8:30:38 AM
   
RE:Rewrite meta description using macro
I am adding {% Description %} to the DocumentPageDescription system attribute default value. It has no effect, regardless of what I do to Properties>Metadata - I expected the system attribute to override the Properties>Metadata.

Because there are thousands of of the document types, and they keep getting added, we cannot modify the Properties>Metadata on each instance. The system attribute with a default value looks like the perfect solution.

User avatar
Member
Member
eric.savage-clyral - 9/26/2012 8:31:42 AM
   
RE:Rewrite meta description using macro
(sorry, using 6.0.47, and Description is an editable field on the document type)

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 9/26/2012 8:46:25 AM
   
RE:Rewrite meta description using macro
Hello,


The default value of any field works only for new documents, not existing documents. It simply uses this value for a field when you insert a document.

If the system field is hidden, the only possibility to enter a value for this field is the default value when inserting documents. If you enable this field for editing, you can see it synchronizes the value on the Form tab with document Properties -> Metadata.

If you insert a new document, does it work correctly?

If you want to update a huge amount of documents, you use API to update them. If you need any details, feel free to ask.


Best regards,
Helena Grulichova

User avatar
Member
Member
eric.savage-clyral - 9/26/2012 8:53:43 AM
   
RE:Rewrite meta description using macro
Ok, that will work for me. I will modify the existing documents directly by a script on the DB and then all new documents can get the default value. Thanks.

User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 9/28/2012 8:17:28 AM
   
RE:Rewrite meta description using macro
I just wanted to say that using the meta fields in the document type form to set the macros for those meta tags is a great idea that I hadn't thought of.

I've been suggesting on UserVoice and even talked with the CTO of Kentico about (Martin) how Meta tag inheritance was rarely suitable for my needs. I had suggested that a new tab or something be added to the document type editor to set those macros. As a temporary solution, I have been using macro conditions based on the document type in the parent document or adding a static text web parts with the macros for the meta tags in them. I like your idea better though, and I will likely start using it.

Your solution also gave me an idea of how the folks at Kentico might be able to easily implement a way to do this without changing too much of the code.

1. Add a tab (or some other place for a form) to the document management field where we can manage the text or macros for the meta tags

2. Upon save, get all of the documents of that type where the meta field values are equal to the values in the form before it was changed and only update those. That way it can keep any values that may have been customized manually.

3. Add an option to the form to replace the values on all documents of that type using a path expression. That way we could overwrite any custom values if we need to, but we can also have some control to leave some of them alone.


User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 10/1/2012 6:54:17 AM
   
RE:Rewrite meta description using macro
Hello,


Can you please suggest it on http://kentico.uservoice.com? Our developers will consider it. The voices will give us also feedback how many people appreciate this feature. Thank you in advance.


Best regards,
Helena Grulichova