Keyword modifier to print published or created date


(Innes Zenati) #1

Hey all,

Look for some help with a keyword modifier…

I am looking to show a specific date when a schema is present, it will always use the same layout but depending on what schema is used the dates behave differently. It would be better to have this automatic so if one schema is present it will print the published date but if the other is used it will print the created date.

Published: %asset_metadata_news.publication.date^date_format:d F Y%

This is what I currently have to print the last published date, if the standard page doesnt have that specific schema then I need to print the created date. Would i need to add in a selectable condition in the metadata to make this work??


(Harinder Singh) #2

Use conditional keyowrds to achieve this.

Also, when you say ‘schema is present,’ do you mean it has been applied or that a value has been entered in the field?


(Nick Papadatos) #3

Hello,

You can also just use:
Published: %asset_metadata_news.publication.date^gt:0:{asset_metadata_news.publication.date^date_format:d F Y}: {asset_created_readabledate^date_format:d F Y}%

This would basically use the same date format regardless


(Innes Zenati) #4

Hi Hardiner, yes I mean applied. I might be able to implement a date selection field to the metadata scheme to mirror what is on the other one. That was no matter what schema is applied you have to choose whether to use published or created date. Thanks


(Innes Zenati) #5

Thanks NIcky, this is another option which would be ideal.