Skip to content

Commit

Permalink
Merge pull request #3603 from plentymarkets/feat/single-item-title
Browse files Browse the repository at this point in the history
feat: update single item title composition
  • Loading branch information
doproiescu-plenty authored Nov 4, 2024
2 parents 4ccd757 + 471b76a commit 59e5ccb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Binary file added resources/views/.DS_Store
Binary file not shown.
8 changes: 7 additions & 1 deletion resources/views/Item/SingleItemWrapper.twig
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,14 @@
{% set robotsValue = robots %}
{% endif %}

{% if itemData.texts.title is defined and itemData.texts.title | trim is not empty %}
{% set removeTitleCompanyName = true %}
{% endif %}

{% embed getPartial('page-metadata') %}
{% block title ItemName.get(itemData | itemName(webstoreConfig.urlTitleItemName - 1, ""), itemData.variation.bundleType) %}
{% block title %}
{{ itemData.texts.title | default(ItemName.get(itemData | itemName(webstoreConfig.urlTitleItemName - 1, ""), itemData.variation.bundleType)) }}
{% endblock %}
{% block description itemData.texts.metaDescription %}
{% block keywords itemData.texts.keywords %}
{% block image itemData.images.all[0].url %}
Expand Down
8 changes: 5 additions & 3 deletions resources/views/PageDesign/Partials/PageMetadata.twig
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@
{% set type = block('type') | default('article') %}
{% set url = block('url') | default(services.url.getCanonicalURL()) | default(webstoreConfig.domainSsl) %}

{% if title | trim is not empty %}
{% set title = title ~ " | " %}
{% if removeTitleCompanyName is not defined or not removeTitleCompanyName %}
{% if title | trim is not empty %}
{% set title = title ~ " | " %}
{% endif %}
{% set title = title ~ trans("Ceres::Template.headerCompanyName") %}
{% endif %}
{% set title = title ~ trans("Ceres::Template.headerCompanyName") %}

{% if image starts with 'category/' %}
{% set image = "/documents/" ~ image %}
Expand Down

0 comments on commit 59e5ccb

Please sign in to comment.