[#setting locale=themeDisplay.getLanguageId() /] [#setting date_format="yyyy-MM-dd" /] [#assign claim_status_style = { "claimed": "ml-3 label label-tonal-info ml-2", "unclaimed": "ml-3 label label-tonal-warning ml-2" } /] [#assign request_status_style = { "active": "label label-tonal-info ml-2", "submitted": "label label-tonal-warning ml-2", "approved": "label label-tonal-success ml-2", "expired": "label label-tonal-danger ml-2" } /] [#assign mdf_request_id = (request.getAttribute("INFO_ITEM").objectEntryId)! /] [#function days_difference_from_now date] [#return (date?long - .now?long) / (1000 * 60 * 60 * 24) /] [/#function] [#function get_event_fields activity] [#return [{ "title": "Activity Description", "value": (activity.description)!"-"}, { "title": "Venue Name", "value": (activity.venueName)!"-" }, { "title": "Liferay Branding", "value": (activity.liferayBranding)!"-" }, { "title": "Liferay Participation / Requirements", "value": (activity.liferayParticipationRequirements)!"-" }, { "title": "Source and Size of Invitee List", "value": (activity.sourceAndSizeOfInviteeList)!"-" }, { "title": "Activity Promotion", "value": (activity.activityPromotion)!"-" }] /] [/#function] [#function get_digital_marketing_fields activity] [#return [{ "title": "Overall message, content or CTA", "value": (activity.overallMessageContentCTA)!"-"}, { "title": "Specific sites to be used", "value": (activity.specificSites)!"-" }, { "title": "Keywords for PPC campaigns", "value": (activity.keywordsForPPCCampaigns)!"-" }, { "title": "Ad (any size/type)", "value": (activity.ad)!"-" }, { "title": "Do you require any assets from Liferay?", "value": (activity.assetsLiferayRequired?string("Yes", "No")!"-") }, { "title": "How will the Liferay brand be used in the campaign?", "value": (activity.howLiferayBrandUsed)!"-" }] /] [/#function] [#function get_content_marketing_fields activity] [#return [{ "title": "Will this content be gated and have a landing page?", "value": (activity.gatedLandingPage?string("Yes", "No"))!"-"}, { "title": "Primary theme or message of your content", "value": (activity.primaryThemeOrMessage)!"-" }, { "title": "Goal of Content", "value": (activity.goalOfContent)!"-" }, { "title": "Are you hiring an outside writer or agency to prepare the content?", "value": (activity.hiringOutsideWriterOrAgency?string("Yes", "No"))!"-" }] /] [/#function] [#function get_miscellaneous_marketing_fields activity] [#return [{ "title": "Marketing activity", "value": (activity.marketingActivity)!"-"}] /] [/#function] [#function get_fields_by_activity activity] [#assign fields = { "prmtact001": get_event_fields(activity), "prmtact002": get_digital_marketing_fields(activity), "prmtact003": get_content_marketing_fields(activity), "prmtact004": get_miscellaneous_marketing_fields(activity) }] [#return fields[activity.typeActivity.key] /] [/#function] [#function get_activity_fields activity] [#return [{ "title": "Activity name", "value": (activity.name)!"-" }, { "title": "Type of Activity", "value": (activity.typeActivity.name)!"-" }, { "title": "Tactic", "value": (activity.tactic.name)!"-" }] + get_fields_by_activity(activity) + [{ "title": "Start Date", "value": (activity.startDate?date?string.short)!"-" }, { "title": "End Date", "value": (activity.endDate?date?string.short)!"-" }] /] [/#function] [#macro table title items]
${title} |
|
---|---|
${item.title} |
${item.value} |
Request Status: ${activity_status.name} [#if end_date?has_content] [#assign request_date = days_difference_from_now(end_date) /] ${(request_date > 0)?then(request_date?ceiling, 0)} days left to claim [/#if]
To use this fragment either place it on a Display Page Template to see which attributes are available from request.getAttribute("INFO_ITEM").
It's important to note that this will only display the attributes of a display page when you view the published display page not when you are editing it.