Appearance
Display two-part product titles
Label includes features for handling product titles that have two parts (or more). For example, an audio product's title might contain an artist's name and an album title.
The following image shows a product grid on a store page. Each book in the grid uses a two-part product title that contains the author's name and the title of the book.
Label provides the following methods for displaying two-part product titles on product grids and product pages.
Split product titles using a hyphen
Label can split a product's title into two parts automatically, if you include a hyphen -
character in the product's title. The theme separates the text on either side of the hyphen on product grids and product pages automatically.
Add a hyphen to product titles
For Label to separate hyphenated product titles automatically, you must add a hyphen to the product titles.
To add a hyphen to product titles:
In your Shopify admin menu, select Products.
From the Products list, select a product with a two-part title.
In the following image, all of the products are audio albums with two-part titles. For example, the product title Madonna by Rainbird Williams, is made up of the album title Madonna, and the artist's name Rainbird Williams.
In the Title box, edit the product's two-part title so that each part is separated by a hyphen character.
For example, in the following image, the unedited two-part product title is Madonna by Rainbird Williams.
In the following image, the product title is edited and hyphenated to Madonna - Rainbird Williams.
Repeat the previous steps to hyphenate the two-part titles for all applicable products.
Split hyphenated product titles automatically
To turn on/ off the automatic separation of hyphenated product titles:
Go to Theme settings > Products.
Select/ deselect the checkbox Split title with hyphen (-) character.
Visit a product page to verify that the title displays correctly.
Note
This setting does not affect SEO or metadata associated with products. The hyphen remains included in the page title and search results.
Use a metafield to display product titles
You can simplify complex product titles by storing part of the product title in a metafield. Then, the metafield can be displayed on your store's product grids and product pages.
Note
As an example, the products used in this guide are audio albums with two-part titles. The product titles contain an album title and an artist name. This guide creates an artistName metafield to store the "artist name" part of the product title. The metafield is then displayed on the product pages for audio products.
Adapt the steps in this guide to suit your requirements.
To learn about other types of information that metafields can store, refer to Use metafields on product pages, and Shopify help: Using metafields and dynamic sources
Edit two-part product titles
In your Shopify admin menu, select Products.
From the Products list, select a product with a two-part title.
In the following image, all of the products are audio albums with the two-part titles. For example, the product title Madonna by Rainbird Williams, is made up of the album title Madonna, and the artist's name Rainbird Williams.
In the Title box, edit the product's title so that it uses only one part of it's two-part title.
For example, in the following image, the unedited two-part product title is Madonna by Rainbird Williams.
In the following image, the product title is edited to Madonna. The edited title contains the album title only, and the artist name has been removed. A metafield will be used to store the artist's name.
Repeat the previous steps to edit the two-part titles for all applicable products.
Define a product metafield
In your store's admin, go to Settings > Metafields.
The metafield will store the "artist name" part title that you edited out in the previous step.
On the Metafields page, select Products, and then choose Add definition.
In the Name box, enter a name for the metafield.
For example, to create a metafield for artist names, in the Name text box, enter artistName.
In the Namespace and key box, replace the text
my_fields
withlabel_theme
.For example, in the Namespace and key box, enter the full text
label_theme.artistName
.Important
Make a note of the namespace and key value, you'll recall these values later in this guide.
[Optional] In the Description text box, enter text to describe the metafield.
Choose Select content type.
From the dropdown list, select Text.
Set the checkbox to select Single line text.
Select Save from the Unsaved changes menu at the top of the page.
Set values for the metafield
You must set values for the metafield for each product. For example, for applicable products, the value of the artistName metafield must be set to the name of the artist.
To set values for the metafield:
In your Shopify admin, select Products, and then choose a product from the Products list.
At the bottom of the page, locate the Metafields area.
Select a metafield from the list, and then enter the required values.
For example, select the artistName metafield, and then enter the value
Rainbird Williams
into the text box.Select Save.
Repeat the previous steps to set metafield values for all applicable products.
Add the metafield to the product grid and product pages
To add the metafield to the product grid and product pages:
In Theme Editor, go to Theme settings > Products.
Locate the Additional metafield menu area.
Note
Refer to Products.
In the Metafield key box, enter the namespace and key value that you noted in a previous step.
For example, in the Metafield key box, enter
label_theme.artistName
.Select the following menu options:
To display the metafield on collection grids, select the checkbox Show on collection grid.
To display the metafield on product pages, select the checkbox Show on product page.
Visit the corresponding store page to verify that the metafield displays correctly.
Note
Metafield values are not returned in search results. So, it's good practice to tag products with the same value as the metafield. For example, tag the product with the name of the artist to match the value of the artistName
metafield.