Macro to get the image value under Form on a page

David Pearson asked on September 11, 2017 19:34

I am trying to use the image field under Page >> Form tab... Hoping to use this field for a Facebook Open graph image. What is the marco method for this value?

Also is this the best way, can I add a field maybe under Metadata? Thanks David

Correct Answer

Trevor Fayas answered on September 11, 2017 19:52

If you are on the page, any Form tab data is passed into the macro context. So if your image is called "TeaserImage" then {% TeaserImage %} will pull the value. Take note though that that 'value' may be the GUID, so you may need to either reference the GetMedia page to get the proper image path, or change your form to a URL selector.

0 votesVote for this answer Unmark Correct answer

Recent Answers

David Pearson answered on September 11, 2017 20:17

Thanks, I will try the Teaser Image.

I did get the macro to work with CurrentDocument.CategoryNavigationImage. You have to append the domain and remove ~ to set up as open graph image tag, but it works...

0 votesVote for this answer Mark as a Correct answer

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