Custom Product Titles For Different Locations

constar
Excursionist
4 0 0

How can I set up custom product titles so there are different titles on product pages/collection pages?

i.e.
- Title v1: Product Page
- Title v2: Collection Page 1
- Title v3: Collection Page 2

I would appreciate any insight into solving this.

0 Likes
PaulNewton
Shopify Partner
3131 195 576

Always backup your theme before making changes

This varies wildly by theme in which files and how you will customize things.

Some themes have such things as a theme setting so be sure to check there first.

To customize your html titles , or resource titles(collections,products) use the liquid template object https://shopify.dev/api/liquid/objects/template 

And {% if %} tag or case/when https://shopify.dev/api/liquid/tags/control-flow-tags#case-when 

Problem Solved? ✔️Accept and ? Like the solution so you can help others.
Buy me a coffee ☕ paypal.me/paulnewton or donate to eff.org
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com
0 Likes
constar
Excursionist
4 0 0

@PaulNewton Firstly, thank you for your input.

There is no option in the theme itself, so I'll have to input code manually. I'm not a developer unfortunately (just a business owner) so my knowledge is limited. How would I go about constructing the code from those links? It's a little confusing for a beginner so I'd really appreciate some expertise on this.

Theme is Turbo. Thank you!

0 Likes
PaulNewton
Shopify Partner
3131 195 576

@constar wrote:

There is no option in the theme itself, so I'll have to input code manually. I'm not a developer unfortunately (just a business owner) so my knowledge is limited.


Ah i see this is the technical forum, if you need paid support for this customization contact me at paull.newton+shopifyforums@gmail.com 

 

Your gonna have to do the research and dig through the turbo theme for it's product template,sections and snippets for wherever whichever titles your trying to affect(html <title>'s or <h1> title tags etc.)

As for constructing the code search the forums and google for "shopify how to show on collection pages only"  or other similar word phrases for tutorials or solved posts that deal with the template object using some code similar to below:

{% assign product_title = "" %}
{% if template == "product" %}
 {% assign product_title = product.title %} {% comment %}- Title v1: Product Page{% endcomment %}
{% elseif template== "collection" %}
 {% assign product_title = product.title %}   {% comment %}- the default collection template{% endcomment %}
{% endif %}

{% if template.suffix == "collection-page-1-handle" %}
  {% assign product_title = product.title %}   {% comment %}- Title v2: Collection Page 1 alternative template{% endcomment %}
{% elseif template.suffix == "collection-page-2-handle" %}
  {% assign product_title = product.title %}  {% comment %}- Title v3: Collection Page 2 alternative template{% endcomment %}
{% endif %}

 Note: Use case/when if logic is longer, and unless the titles are consistently following a convention you'll probably want to make the alternative titles use metafield definitions

Problem Solved? ✔️Accept and ? Like the solution so you can help others.
Buy me a coffee ☕ paypal.me/paulnewton or donate to eff.org
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com
0 Likes