diff --git a/blueprints/blog.yaml b/blueprints/blog.yaml index f18c217..b532929 100644 --- a/blueprints/blog.yaml +++ b/blueprints/blog.yaml @@ -69,22 +69,9 @@ form: options: asc: FUTURE.ADMIN.BLOG.BLOG_CONTENT_ITEMS_ORDER_DIR_ASC desc: FUTURE.ADMIN.BLOG.BLOG_CONTENT_ITEMS_ORDER_DIR_DESC - - header.show_breadcrumbs: + + header.content.pagination: type: toggle - toggleable: true - label: FUTURE.ADMIN.BLOG.BLOG_CONTENT_ITEMS_BREADCRUMBS - highlight: 1 - default: 1 - options: - 1: PLUGIN_ADMIN.ENABLED - 0: PLUGIN_ADMIN.DISABLED - validate: - type: bool - - header.show_pagination: - type: toggle - toggleable: true label: FUTURE.ADMIN.BLOG.BLOG_CONTENT_ITEMS_PAGINATION highlight: 1 default: 1 @@ -93,10 +80,9 @@ form: 0: PLUGIN_ADMIN.DISABLED validate: type: bool - + header.content.url_taxonomy_filters: type: toggle - toggleable: true label: FUTURE.ADMIN.BLOG.BLOG_CONTENT_ITEMS_URL_TAXONOMY_FILTERS highlight: 1 default: 1 @@ -127,5 +113,9 @@ form: whatsapp: Whatsapp telegram: Telegram use: keys + + import@: + type: partials/blog-bits + context: blueprints://pages diff --git a/blueprints/default.yaml b/blueprints/default.yaml index 34bc6da..a5690b9 100755 --- a/blueprints/default.yaml +++ b/blueprints/default.yaml @@ -22,14 +22,47 @@ form: header.subtitle: type: text style: vertical + size: long label: FUTURE.ADMIN.ITEM.ITEM_SUBTITLE + image_section: + type: section + underline: true + title: FUTURE.ADMIN.DEFAULT.IMAGE_OPTIONS + header.show_pageimage: + type: toggle + style: vertical + label: FUTURE.ADMIN.DEFAULT.SHOW_PAGEIMAGE + help: FUTURE.ADMIN.DEFAULT.SHOW_PAGEIMAGE_HELP + default: 1 + highlight: 1 + options: + 1: PLUGIN_ADMIN.ENABLED + 0: PLUGIN_ADMIN.DISABLED + validate: + type: bool header.primaryImage: ordering@: header.subtitle style: vertical size: medium type: pagemediaselect - label: FUTURE.ADMIN.DEFAULT.PRIMARY_IMAGE + label: FUTURE.ADMIN.DEFAULT.PRIMARY_IMAGE.LABEL preview_images: true + header.image_width: + type: number + style: vertical + label: FUTURE.ADMIN.DEFAULT.PRIMARY_IMAGE.WIDTH + size: small + default: 1038 + header.image_height: + type: number + style: vertical + label: FUTURE.ADMIN.DEFAULT.PRIMARY_IMAGE.HEIGHT + size: small + default: 437 + content_section: + type: section + underline: true + title: FUTURE.ADMIN.DEFAULT.CONTENT options: fields: publishing: diff --git a/blueprints/modular/banner.yaml b/blueprints/modular/banner.yaml index b159b98..ad0a3fa 100644 --- a/blueprints/modular/banner.yaml +++ b/blueprints/modular/banner.yaml @@ -12,8 +12,16 @@ form: fields: header.content: fields: + image_section: + unset@: true header.primaryImage: unset@: true + header.show_pageimage: + unset@: true + header.image_width: + unset@: true + header.image_height: + unset@: true banner: type: tab title: FUTURE.ADMIN.MODULAR.BANNER.BANNER_TAB diff --git a/blueprints/partials/blog-bits.yaml b/blueprints/partials/blog-bits.yaml new file mode 100644 index 0000000..6af700f --- /dev/null +++ b/blueprints/partials/blog-bits.yaml @@ -0,0 +1,39 @@ +form: + fields: + + blog_config: + type: spacer + title: FUTURE.ADMIN.BLOG.BLOG_CONFIGURATION + + header.blog_url: + type: text + toggleable: true + label: FUTURE.ADMIN.BLOG.BLOG_ROUTE + help: FUTURE.ADMIN.BLOG.BLOG_ROUTE_HELP + default: '/blog' + placeholder: '/blog' + size: medium + + header.show_breadcrumbs: + type: toggle + toggleable: true + label: FUTURE.ADMIN.BLOG.BLOG_CONTENT_ITEMS_BREADCRUMBS + highlight: 1 + default: 1 + options: + 1: PLUGIN_ADMIN.ENABLED + 0: PLUGIN_ADMIN.DISABLED + validate: + type: bool + + header.show_pagination: + type: toggle + toggleable: true + label: FUTURE.ADMIN.BLOG.BLOG_CONTENT_ITEMS_SHOWPAGINATION + highlight: 1 + default: 1 + options: + 1: PLUGIN_ADMIN.ENABLED + 0: PLUGIN_ADMIN.DISABLED + validate: + type: bool \ No newline at end of file diff --git a/languages.yaml b/languages.yaml index dd5b2ed..6bd5e96 100755 --- a/languages.yaml +++ b/languages.yaml @@ -55,7 +55,14 @@ en: CUSTOM_MENU_ITEM_TARGET_SELF: 'Open in the same frame as clicked' CUSTOM_MENU_ITEM_TARGET_TOP: 'Open in the full body of the window' DEFAULT: - PRIMARY_IMAGE: Primary image + CONTENT: Content + IMAGE_OPTIONS: Image options + PRIMARY_IMAGE: + LABEL: Primary image + WIDTH: Width + HEIGHT: Height + SHOW_PAGEIMAGE: Show Image + SHOW_PAGEIMAGE_HELP: Enable primary image if it is defined or the first image of the media page. SHOW_SIDEBAR: Show Sidebar BODY_CLASSES: 'You can create new CSS classes for the body and add them here' MODULAR: @@ -81,6 +88,9 @@ en: BLOG: BLOG_TAB: Blog Config + BLOG_CONFIGURATION: Configuration + BLOG_ROUTE: Blog Route + BLOG_ROUTE_HELP: The route to the main blog page that contains the "Show ..." configuration BLOG_CONTENT_TITLE: Content Definition BLOG_CONTENT_ITEMS: Items BLOG_CONTENT_ITEMS_LIMIT: Max Item Count @@ -93,7 +103,8 @@ en: BLOG_CONTENT_ITEMS_ORDER_DIR_ASC: Ascending BLOG_CONTENT_ITEMS_ORDER_DIR_DESC: Descending BLOG_CONTENT_ITEMS_BREADCRUMBS: Show Breadcrumbs - BLOG_CONTENT_ITEMS_PAGINATION: Show Pagination + BLOG_CONTENT_ITEMS_SHOWPAGINATION: Show Pagination + BLOG_CONTENT_ITEMS_PAGINATION: Pagination BLOG_CONTENT_ITEMS_URL_TAXONOMY_FILTERS: URL Taxonomy Filters BLOG_CONTENT_SHAREICONS_TITLE: Social Media Icons BLOG_CONTENT_SHAREICONS: Select Social Media Icons @@ -288,7 +299,14 @@ de: CUSTOM_MENU_ITEM_TARGET_SELF: In selbem Frame öffnen CUSTOM_MENU_ITEM_TARGET_TOP: In vollem Fensterkörper öffnen DEFAULT: - PRIMARY_IMAGE: Hauptbild + CONTENT: Inhalt + IMAGE_OPTIONS: Bildoptionen + PRIMARY_IMAGE: + LABEL: Hauptbild + WIDTH: Breite + HEIGHT: Höhe + SHOW_PAGEIMAGE: Show Image + SHOW_PAGEIMAGE_HELP: Enable primary image if it is defined or the first image of the media page. SHOW_SIDEBAR: Seitenleiste anzeigen BODY_CLASSES: 'Sie können neue CSS-Klassen für den body erstellen und hier hinzufügen.' MODULAR: @@ -314,6 +332,9 @@ de: BLOG: BLOG_TAB: Blog-Einstellungen + BLOG_CONFIGURATION: Konfiguration + BLOG_ROUTE: Blogroute + BLOG_ROUTE_HELP: Die Route zur Hauptseite des Blogs, die die Konfiguration "Show ..." enthält BLOG_CONTENT_TITLE: Inhaltseinstellungen BLOG_CONTENT_ITEMS: Artikel BLOG_CONTENT_ITEMS_LIMIT: Maximale Artikel-Anzahl @@ -326,7 +347,8 @@ de: BLOG_CONTENT_ITEMS_ORDER_DIR_ASC: Aufsteigend BLOG_CONTENT_ITEMS_ORDER_DIR_DESC: Absteigend BLOG_CONTENT_ITEMS_BREADCRUMBS: Brotkrümelnavigation anzeigen - BLOG_CONTENT_ITEMS_PAGINATION: Seitennummerierung + BLOG_CONTENT_ITEMS_SHOWPAGINATION: Paginierung anzeigen + BLOG_CONTENT_ITEMS_PAGINATION: Paginierung BLOG_CONTENT_ITEMS_URL_TAXONOMY_FILTERS: Taxonomie filtern nach URL ITEM: ITEM_TAB: Blog-Artikel @@ -518,7 +540,14 @@ es: CUSTOM_MENU_ITEM_TARGET_SELF: 'Abrir en el mismo marco en el que se hizo clic' CUSTOM_MENU_ITEM_TARGET_TOP: 'Abrir en todo el cuerpo de la ventana' DEFAULT: - PRIMARY_IMAGE: Imagen principal + CONTENT: Contenido + IMAGE_OPTIONS: Opciones de imagen + PRIMARY_IMAGE: + LABEL: Imagen principal + WIDTH: Ancho + HEIGHT: Alto + SHOW_PAGEIMAGE: Mostrar imagen + SHOW_PAGEIMAGE_HELP: Habilitar la imagen principal si está definida o la primera de las imágenes de la página. SHOW_SIDEBAR: Mostrar Barra Lateral BODY_CLASSES: 'Puede crear nuevas clases CSS para el body y añadirlas aquí.' MODULAR: @@ -544,6 +573,9 @@ es: BLOG: BLOG_TAB: Configuración del Blog + BLOG_CONFIGURATION: Configuración + BLOG_ROUTE: Ruta del Blog + BLOG_ROUTE_HELP: La ruta a la página principal del blog que contiene la configuración "Mostrar..." BLOG_CONTENT_TITLE: Definición de Contenido BLOG_CONTENT_ITEMS: Artículos BLOG_CONTENT_ITEMS_LIMIT: Límite máximo de artículos @@ -556,7 +588,8 @@ es: BLOG_CONTENT_ITEMS_ORDER_DIR_ASC: Ascendente BLOG_CONTENT_ITEMS_ORDER_DIR_DESC: Descendente BLOG_CONTENT_ITEMS_BREADCRUMBS: Mostrar Migas de Pan - BLOG_CONTENT_ITEMS_PAGINATION: Mostrar Paginación + BLOG_CONTENT_ITEMS_SHOWPAGINATION: Mostrar paginación + BLOG_CONTENT_ITEMS_PAGINATION: Paginación BLOG_CONTENT_ITEMS_URL_TAXONOMY_FILTERS: Filtros de taxonomía por URL BLOG_CONTENT_SHAREICONS_TITLE: Iconos de Redes Sociales BLOG_CONTENT_SHAREICONS: Mostrar iconos de Redes Sociales diff --git a/templates/blog.html.twig b/templates/blog.html.twig index ee45fe5..10c935e 100755 --- a/templates/blog.html.twig +++ b/templates/blog.html.twig @@ -5,7 +5,6 @@ {% set feed_url = base_url %} {% set show_breadcrumbs = header_var('show_breadcrumbs')|defined(true) %} {% set show_pagination = header_var('show_pagination')|defined(true) %} -{% set show_sidebar = header_var('show_sidebar')|defined(false) %} {% set image = page.media[page.header.primaryImage] ?: page.media.images|first %} {% set title = page.title|raw %} @@ -68,5 +67,7 @@ {% endblock %} {% block sidebar %} +{% if show_sidebar == true %} {% include 'partials/sidebar_left.html.twig' %} +{% endif %} {% endblock %} diff --git a/templates/default.html.twig b/templates/default.html.twig index 61b7e6d..a51221b 100755 --- a/templates/default.html.twig +++ b/templates/default.html.twig @@ -1,7 +1,12 @@ {% extends 'partials/base.html.twig' %} -{% set show_sidebar = header_var('show_sidebar')|defined(false) %} -{% set image = page.media[page.header.primaryImage] ? : page.media.images|first -%} + +{# Define if the primary image and the attributes of width and height are shown #} +{% set show_image = header_var('show_pageimage')|defined(true) %} +{% set image = page.media[page.header.primaryImage] ?: page.media.all|filter((v, k) => k != page.header.primaryImage and (v.type == 'image' or v.type == 'vector'))|first %} +{% set img_width = header_var('image_width')|default(1038) %} +{% set img_height = header_var('image_height')|default(437) %} + +{# Set title and subtitle #} {% set title = page.title|raw %} {% set subtitle = page.header.subtitle|raw %} @@ -13,24 +18,21 @@
-

- {{ title }} -

+

{{ title }}

{% if subtitle %} -

- {{ subtitle }} -

+

{{ subtitle }}

{% endif %}
- {% if image %} + {% if show_image and image %} - {{ image.cropZoom(1038, 437).loading('lazy').attribute('decoding','async').html(title, title)|raw }} + {{ image.cropZoom(img_width, img_height).loading('lazy').attribute('decoding','async').html(title, title)|raw }} - {% endif %} + {% endif %} {{ page.content|raw }} +
{% if show_sidebar == false %} @@ -41,5 +43,7 @@ {% endblock %} {% block sidebar %} +{% if show_sidebar == true %} {% include 'partials/sidebar_left.html.twig' %} +{% endif %} {% endblock %} diff --git a/templates/item.html.twig b/templates/item.html.twig index a1b7162..c3e0a6b 100755 --- a/templates/item.html.twig +++ b/templates/item.html.twig @@ -34,5 +34,7 @@ {% endblock %} {% block sidebar %} +{% if show_sidebar == true %} {% include 'partials/sidebar_left.html.twig' %} +{% endif %} {% endblock %} diff --git a/templates/modular.html.twig b/templates/modular.html.twig index bbf57d1..61b29d0 100755 --- a/templates/modular.html.twig +++ b/templates/modular.html.twig @@ -1,6 +1,12 @@ {% extends 'partials/base.html.twig' %} -{% set show_sidebar = header_var('show_sidebar')|defined(false) %} -{% set image = page.media[page.header.primaryImage] ?: page.media.images|first %} + +{# Define if the primary image and the attributes of width and height are shown #} +{% set show_image = header_var('show_pageimage')|defined(true) %} +{% set image = page.media[page.header.primaryImage] ?: page.media.all|filter((v) => (v.type == 'image' or v.type == 'vector'))|first %} +{% set img_width = header_var('image_width')|default(1038) %} +{% set img_height = header_var('image_height')|default(437) %} + +{# Set title and subtitle #} {% set title = page.title|raw %} {% set subtitle = page.header.subtitle|raw %} @@ -26,9 +32,9 @@ - {% if image %} + {% if show_image and image %} - {{ image.cropZoom(1038,437).loading('lazy').attribute('decoding','async').html(title, title)|raw }} + {{ image.cropZoom(img_width,img_height).loading('lazy').attribute('decoding','async').html(title, title)|raw }} {% endif %} @@ -40,6 +46,10 @@ {% endblock %} + {% block sidebar %} +{% if show_sidebar == true %} {% include 'partials/sidebar_left.html.twig' %} +{% endif %} {% endblock %} + diff --git a/templates/modular/banner.html.twig b/templates/modular/banner.html.twig index 1c8d6a2..bb6f451 100644 --- a/templates/modular/banner.html.twig +++ b/templates/modular/banner.html.twig @@ -1,4 +1,6 @@ -{% set image = page.media[page.header.image] ?: page.media.images|first %} +{# Set banner image #} +{% set image = page.media[page.header.image] ?: page.media.all|filter((v) => (v.type == 'image' or v.type == 'vector'))|first %} + {% set title = page.title|raw %} {% set subtitle = page.header.subtitle|raw %} diff --git a/templates/modular/features.html.twig b/templates/modular/features.html.twig index ce90182..9b3c6e3 100644 --- a/templates/modular/features.html.twig +++ b/templates/modular/features.html.twig @@ -1,6 +1,16 @@ -{% set image = page.media[page.header.primaryImage] ?: page.media.images|first %} +{# Define if sidebar is shown in the page #} +{% set show_image = header_var('show_pageimage')|defined(true) %} + +{# Define if the primary image and the attributes of width and height are shown #} +{% set image = page.media[page.header.primaryImage] ?: page.media.all|filter((v) => (v.type == 'image' or v.type == 'vector'))|first %} +{% set img_width = header_var('image_width')|default(1038) %} +{% set img_height = header_var('image_height')|default(437) %} + +{# Set title and subtitle #} {% set title = page.title|raw %} {% set subtitle = page.header.subtitle|raw %} + +{# Set columns for features page #} {% set columns = page.header.layout == 'standard' ? 'col-4 col-6-medium col-12-small' : 'col-6 col-12-small' %}
@@ -11,8 +21,8 @@ {% endif %} - {% if image %} - {{ image.cropZoom(1038,437).loading('lazy').attribute('decoding','async').html(title, title, 'image featured')|raw }} + {% if show_image and image %} + {{ image.cropZoom(img_width,img_height).loading('lazy').attribute('decoding','async').html(title, title, 'image featured')|raw }} {% endif %} {{ page.content|raw }} diff --git a/templates/partials/base.html.twig b/templates/partials/base.html.twig index 61cdc6a..4dc4f1a 100644 --- a/templates/partials/base.html.twig +++ b/templates/partials/base.html.twig @@ -3,6 +3,9 @@ {% set favicon = theme_config.favicon ? theme_config.favicon|first : { type:'image/png', path: url('theme://images/favicon.png') } %} {% set new_base_url = base_url_absolute ~ theme_config.blog_page %} +{# Define if sidebar is shown in the page #} +{% set show_sidebar = header_var('show_sidebar')|defined(false) %} + @@ -54,9 +57,9 @@
{% block content %}{% endblock %}
- {% if show_sidebar == true %} + {% block sidebar %}{% endblock %} - {% endif %} + {% endblock %} {% endblock %} diff --git a/templates/partials/blog_item.html.twig b/templates/partials/blog_item.html.twig index 164f17b..a356e24 100644 --- a/templates/partials/blog_item.html.twig +++ b/templates/partials/blog_item.html.twig @@ -10,9 +10,18 @@ {% set author = page.taxonomy.author[0] %} {% endif %} - {% set title = page.title|raw %} - {% set avatar = page.media[page.header.avatarImage].url|e %} - {% set image = page.media[page.header.primaryImage] ?: page.media.all|filter((v, k) => k != page.header.avatarImage and (v.type == 'image' or v.type == 'vector'))|first %} +{# Set avatar image and primary image #} +{% set avatar = page.media[page.header.avatarImage].url|e %} +{% set image = page.media[page.header.primaryImage] ?: page.media.all|filter((v, k) => k != page.header.avatarImage and (v.type == 'image' or v.type == 'vector'))|first %} + +{# Define if the primary image and the attributes of width and height are shown #} +{% set show_image = header_var('show_pageimage')|defined(true) %} +{% set img_width = header_var('image_width')|default(1038) %} +{% set img_height = header_var('image_height')|default(437) %} + +{# Set title and subtitle #} +{% set title = page.title|raw %} +{% set subtitle = page.header.subtitle|raw %}
@@ -28,8 +37,8 @@ {{ title }} {% endif %} - {% if page.header.subtitle %} -

{{ page.header.subtitle|raw }}

+ {% if subtitle %} +

{{ subtitle|raw }}

{% endif %}
@@ -49,9 +58,9 @@ {% endif %}
- {% if image %} + {% if show_image and image %} - {{ image.cropZoom(1038,437).loading('lazy').attribute('decoding','async').html(title, title)|raw }} + {{ image.cropZoom(img_width,img_height).loading('lazy').attribute('decoding','async').html(title, title)|raw }} {% endif %}
diff --git a/templates/partials/miniposts.html.twig b/templates/partials/miniposts.html.twig index 3bb04aa..de3d897 100644 --- a/templates/partials/miniposts.html.twig +++ b/templates/partials/miniposts.html.twig @@ -19,6 +19,11 @@ {% set title = p.title|raw %} {% set avatar = p.media[p.header.avatarImage].url|e %} {% set image = p.media[p.header.primaryImage] ?: p.media.all|filter((v, k) => k != p.header.avatarImage and (v.type == 'image' or v.type == 'vector'))|first %} + + {# Define if the primary image and the attributes of width and height are shown #} + {% set show_image = p.header.show_pageimage|defined(true) %} + {% set img_width = p.header.image_width|default(1038) %} + {% set img_height = p.header.image_height|default(437) %} diff --git a/templates/portfolio.html.twig b/templates/portfolio.html.twig index 220281b..63d993e 100755 --- a/templates/portfolio.html.twig +++ b/templates/portfolio.html.twig @@ -1,6 +1,11 @@ {% extends 'partials/base.html.twig' %} -{% set show_sidebar = header_var('show_sidebar')|defined(false) %} -{% set image = page.media[page.header.primaryImage] %} + +{# Define if the primary image and the attributes of width and height are shown #} +{% set image = page.media[page.header.primaryImage] ?: page.media.all|filter((v) => (v.type == 'image' or v.type == 'vector'))|first %} +{% set img_width = header_var('image_width')|default(1038) %} +{% set img_height = header_var('image_height')|default(437) %} + +{# Set title and subtitle #} {% set title = page.title|raw %} {% set subtitle = page.header.subtitle|raw %} {% set columns = page.header.layout == 'standard' ? 'col-4 col-6-medium col-12-small' : 'col-6 col-12-small' %} @@ -9,9 +14,10 @@ {{ parent() }} {% do assets.addCss('theme://assets/css/glightbox.min.css') %} {% set styling %} - button.gclose.gbtn, button.gnext.gbtn, button.gprev.gbtn { - box-shadow: none !important; - } + button.gclose.gbtn, button.gnext.gbtn, button.gprev.gbtn { + box-shadow: none !important; + } + {% endset %} {% do assets.addInlineCss(styling) %} {% endblock %} @@ -28,19 +34,15 @@
-

- {{ title }} -

+

{{ title }}

{% if subtitle %} -

- {{ subtitle }} -

+

{{ subtitle }}

{% endif %}
- {% if image %} + {% if show_image and image %} - {{ image.cropZoom(1038,437).loading('lazy').attribute('decoding','async').html(title, title)|raw }} + {{ image.cropZoom(img_width,img_height).loading('lazy').attribute('decoding','async').html(title, title)|raw }} {% endif %} @@ -50,19 +52,19 @@ {% block portfolio %}
- {% for item in gallery %} - {% set item_image = page.media[item.image] %} + {% for item in gallery %} + {% set item_image = page.media[item.image] %} {% set item_title = item.title %} {% set item_desc = item.description %} {% set thumbnail = item_image.cropZoom(thumb_w, thumb_h).loading('lazy').attribute('decoding','async').attribute('itemprop','http://schema.org/image').html(item_title,item_title) %} - - {% endfor %} + + {% endfor %}
{% endblock %} @@ -76,7 +78,9 @@ {% endblock %} {% block sidebar %} +{% if show_sidebar == true %} {% include 'partials/sidebar_left.html.twig' %} +{% endif %} {% endblock %} {% block javascripts %} diff --git a/templates/simplesearch_results.html.twig b/templates/simplesearch_results.html.twig index e6f3313..048b791 100755 --- a/templates/simplesearch_results.html.twig +++ b/templates/simplesearch_results.html.twig @@ -1,6 +1,6 @@ {% extends 'partials/base.html.twig' %} -{% set show_sidebar = theme_var('sidebar')|defined(false) %} +{% set sidebar = theme_var('sidebar')|defined(false) %} {% block menu %} {% include 'partials/sidebar_right.html.twig' %} @@ -35,7 +35,7 @@ {% endfor %}
- {% if show_sidebar == false %} + {% if sidebar == false %} @@ -43,5 +43,8 @@ {% endblock %} {% block sidebar %} +{% if sidebar == true %} {% include 'partials/sidebar_left.html.twig' %} +{% endif %} {% endblock %} +