Setting macro on meta default value in page type page field does not work

Pedro Costa asked on July 22, 2015 17:15

Hi All,

I was hopping this would be a walk in the part, but am having issues with creating new products (custom page type that has "Page type represents a product type" checked) with default macro driven values for the meta data:

Image Text

It's just not picking it up, after adding the product the meta data does not have the Inherit box checked, however the value for the field is always empty, I expected to see the macro here:

Image Text

If do set the macro manually and save the product it starts working but that's not feasible for the client has they would need to know what macro's to use where...

Could this be a bug? Can anyone else confirm if they have page field with default macro values working?

I'm running v8.2.28 in a web app project.

Any help will be greatly appreciated.

Cheers, P.

Recent Answers


Roman Hutnyk answered on July 22, 2015 17:31

Pedro,

Macro in default value is being resolved while creating the document (when system renders create form). At that point of time the SKUShortDescription or any other fields is blank (null).

So this is not an issue, this is correct behavior, the only thing is that it does not meet your expectation. I'm sorry.

You may copy SKUShortDescription to some other field in Document Insert before event handler. Details are here.

1 votesVote for this answer Mark as a Correct answer

Pedro Costa answered on July 22, 2015 17:37

Oh, I see, so that's why it's empty cause macros in the default value are rendered with the create form, oh well guess I'll have to use the events for this :(

Thanks for the clarification Roman, have a great day :)

Cheers, P.

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on July 23, 2015 04:47

Pedro, set the macro in the metadata fields themselves. I've one it several times for blogs, news, events, etc. Works like a charm.

0 votesVote for this answer Mark as a Correct answer

Pedro Costa answered on July 23, 2015 10:17

Hi Brenden,

Unfortunately this does not help for new products, as the client would need to know the macros to set them after creating the product. Unless I'm misunderstanding your suggestion?

Thanks, P.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.