The goal:e.g there is document has images, use that image for
<meta property="og:image" content=" HERE SHOULD BE IMAGE URL "/>
1. I have file /template/decorator/default/header-css.ftl with META tags
2. I need to access html content of a document/discussion etc. , parse it and get image url to put it in meta tag
How can I access HTML content of a document/discussion etc.?
Is there another approach to solve a problem?
FTL is a server-side technology. You'll need to check for the existence of the environment variables such as document, thread, blogpost, etc... and then invoke the necessary methods to get image URL(s).
Once you have the object reference, you can use Javadocs or introspection to find the appropriate methods.
Hope that helps.