{# Variables - activePage (\Mautic\PageBundle\Entity\Page) - variants - translations - permissions - stats - abTestResults - security - pageUrl - previewUrl - logs - dateRangeForm @todo - add landing page stats/analytics #} {# Only show A/B test button if not already a translation of an a/b test #} {% set allowAbTest = (activePage.isPreferenceCenter or (activePage.isTranslation(true) and translations.parent.isVariant)) ? false : true %} {% extends '@MauticCore/Default/content.html.twig' %} {% block mauticContent %}page{% endblock %} {% block indexButton %} {{ include('@MauticCore/Helper/page_actions.html.twig', { 'item': activePage, 'customButtons': customButtons|default([]), 'templateButtons': { 'close': securityHasEntityAccess( permissions['page:pages:viewown'], permissions['page:pages:viewother'], activePage.createdBy), }, 'routeBase': 'page', 'targetLabel': 'mautic.page.pages'|trans }) }} {% endblock %} {% block headerTitle %}{{ activePage.title }}{% endblock %} {% block actions %} {{ include('@MauticCore/Helper/page_actions.html.twig', { 'item': activePage, 'customButtons': customButtons|default([]), 'templateButtons': { 'edit': securityHasEntityAccess(permissions['page:pages:editown'], permissions['page:pages:editother'], activePage.createdBy), 'abtest': allowAbTest and permissions['page:pages:create'], 'clone': permissions['page:pages:create'], 'delete': securityHasEntityAccess(permissions['page:pages:deleteown'], permissions['page:pages:deleteown'], activePage.createdBy), }, 'routeBase': 'page', }) }} {% endblock %} {% block publishStatus %} {{- include('@MauticCore/Helper/publishstatus_badge.html.twig', { 'entity': activePage, 'status': 'available' }) -}} {% set tags = [] %} {% set tags = tags |merge(activePage.isPreferenceCenter ? [{ type: 'read-only', color: 'warm-gray', label: 'mautic.email.form.preference_center' }] : []) |merge(activePage.isVariant and not activePage.isVariant(true) ? [{ type: 'read-only', color: 'warm-gray', label: 'mautic.email.icon_tooltip.abtest' }] : []) |merge(activePage.isVariant(true) ? [{ color: 'warm-gray', label: 'mautic.core.variant_of'|trans({'%parent%' : variants.parent.getName()}), icon: 'ri-organization-chart' }] : []) |merge(activePage.isTranslation and not activePage.isTranslation(true) ? [{ color: 'warm-gray', label: 'mautic.core.icon_tooltip.translation' }] : []) |merge(activePage.isTranslation(true) ? [{ color: 'warm-gray', label: 'mautic.core.translation_of'|trans({'%parent%' : translations.parent.getName()}), icon: 'ri-translate' }] : []) %} {% include '@MauticCore/Helper/_tag.html.twig' with { tags: tags } %} {% endblock %} {% block content %} {% set variantContent = include('@MauticCore/Variant/index.html.twig', { 'activeEntity': activePage, 'variants': variants, 'abTestResults': abTestResults, 'model': 'page', 'actionRoute': 'mautic_page_action', 'nameGetter': 'getTitle', })|trim %} {% set showVariants = variantContent is not empty %} {% set translationContent = include('@MauticCore/Translation/index.html.twig', { 'activeEntity': activePage, 'translations': translations, 'model': 'page', 'actionRoute': 'mautic_page_action', 'nameGetter': 'getTitle', })|trim %} {% set showTranslations = translationContent is not empty %}
{% set extra_content %} {% if activePage.isVariant(true) %} {% endif %} {% if activePage.isTranslation(true) %} {% endif %} {% if activePage.isPreferenceCenter %}
{{ 'mautic.core.icon_tooltip.preference_center'|trans }}
{% endif %} {% endset %} {% include '@MauticCore/Helper/description.html.twig' with { 'description': activePage.metaDescription, 'extra_content': extra_content } %}
{{ include('@MauticCore/Helper/details.html.twig', {'entity': activePage}, with_context=false) }}
{{ 'mautic.page.pageviews'|trans }}
{{ include('@MauticCore/Helper/graph_dateselect.html.twig', {'dateRangeForm': dateRangeForm, 'class': 'pull-right'}) }}
{{ include('@MauticCore/Helper/chart.html.twig', {'chartData': stats.pageviews, 'chartType': 'line', 'chartHeight': 300}) }}
{{ customContent('details.stats.graph.below', _context) }}
{% if showVariants or showTranslations %}
{% if showVariants %}
{{ variantContent|raw }}
{% endif %} {% if showTranslations %}
{{ translationContent|raw }}
{% endif %}
{% elseif allowAbTest %}
{% include '@MauticCore/Helper/button.html.twig' with { buttons: [ { label: 'mautic.core.ab_test.create', variant: 'tertiary', href: path('mautic_page_action', {'objectAction': 'abtest', 'objectId': activePage.id}), icon: 'ri-arrow-right-s-line', attributes: { 'class': 'create-abtest-link', 'data-toggle': 'ajax' } } ] } %}
{% endif %}
{% if not activePage.isPreferenceCenter %}
{{ 'mautic.page.url'|trans }}
{% include '@MauticCore/Helper/button.html.twig' with { buttons: [ { label: 'mautic.core.open_link', variant: 'ghost', icon_only: true, icon: 'ri-external-link-line', onclick: 'window.open("' ~ pageUrl ~ '", "_blank");', attributes: { 'class': 'btn-nospin' } } ] } %}
{% endif %}
{{ 'mautic.page.preview.url'|trans }}
{% if previewSettingsForm.translation is defined %}
{{ 'mautic.email.preview.show.translation'|trans }}
{{ form_widget(previewSettingsForm.translation) }}
{% endif %} {% if previewSettingsForm.variant is defined %}
{{ 'mautic.email.preview.show.ab.variant'|trans }}
{{ form_widget(previewSettingsForm.variant) }}
{% endif %} {% if previewSettingsForm.contact is defined %}
{{ 'mautic.email.preview.show.contact'|trans }}
{{ form_widget(previewSettingsForm.contact) }}
{% endif %}
{% include '@MauticCore/Helper/button.html.twig' with { buttons: [ { label: 'mautic.core.open_link', variant: 'ghost', icon_only: true, icon: 'ri-external-link-line', onclick: 'window.open("' ~ previewUrl ~ '", "_blank");', attributes: { 'id': 'content_preview_url_button', 'class': 'btn-nospin' } } ] } %}

{{ include('@MauticCore/Helper/recentactivity.html.twig', {'logs': logs}, with_context=false) }}
{% endblock %}