Custom Display, Review and Expiry date in Liferay

Recently we had a requirement where we want all our new articles to go live next day, up for review in 6 months and automatically expire in 1 year. Of course, all this can be overriden by content authors at the time of content creation. But these are the defaults we wanted. To achieve this you have to override JournalArticle model hint as defined in portal-model-hints.xml. Here are the defaults in Liferay

To override this you will have to create an ext(unfortunately that’s the only way to go). In your ext’s ext-impl/src/META-INF folder create ext-model-hints.xml. Copy the <model name=”com.liferay.portlet.journal.model.JournalArticle”> section from portal-model-hints.xml and change the relevant settings. here are the changes we made to meet our needs

One thought on “Custom Display, Review and Expiry date in Liferay

  1. Nagendra Kumar Busam

    Nice post, I was looking for restrict user to select expiration date field to one year – did below change in ext-model-hints.xml

    1
    1

    It’s not reflecting. can you help me how I can restrict user not to be able to select after one year

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *