[MAGNOLIA-4371] Content MetaData is not exposed in templates Created: 12/Apr/12  Updated: 07/May/12  Resolved: 19/Apr/12

Status: Closed
Project: Magnolia
Component/s: templating components
Affects Version/s: 4.5, 4.5.1, 4.5.2
Fix Version/s: 4.5.3

Type: Bug Priority: Major
Reporter: Matt Dertinger Assignee: Federico Grilli
Resolution: Fixed Votes: 0
Labels: freemarker, taglib, templating
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

Hi,

Currently, it appears that content metadata is not exposed in templates. In previous versions the following worked:

${content.metaData.creationDate}

However, in 4.5, it looks like the following change in the Content API (as listed at: Changelog - Content API) doesn't allow this to work:

Magnolia Content class method Equivalent JCR Node method Remarks
getMetaData() MetaDataUtil.getMetaData(Node)  

Let me know if you have any questions.

Cheers,
Matt



 Comments   
Comment by Jan Haderka [ 12/Apr/12 ]

Added to the changelog for next release. Thx for the report.

Comment by Matt Dertinger [ 13/Apr/12 ]

Hi Jan,

Just in case you didn't see my message on IRC, I'm copying it here:

I found the accessors for metaData hiding over at STKTemplatingFunctions
and they accept a jcr node or a contentMap.

I'm thinking it may still be a good idea to include similar methods in TemplatingFunctions for non-STK users, what do you think?

Cheers,
Matt

Generated at Mon Feb 12 03:55:08 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.