# 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.

An example of a product grid with books. Each book has a two-part product title that contains the author name and the book title.

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:

  1. In your Shopify admin menu, select Products.

    The Shopify admin menu.
  2. 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.

    A product list of audio albums with the two-part titles in Shopify admin.
  3. 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.

    An example of an unedited two-part product title in Shopify admin.

    In the following image, the product title is edited and hyphenated to Madonna - Rainbird Williams.

    An example of an edited and hyphenated product title in Shopify admin.
  4. 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:

  1. Go to Theme settings > Products.

  2. Select/ deselect the checkbox Split title with hyphen (-) character.

    The Split title with hyphen options in Theme setting's Products menu.
  3. 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 (opens new window)

# Edit two-part product titles

  1. In your Shopify admin menu, select Products.

    The Shopify admin menu.
  2. 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.

    A product list of audio albums with the two-part titles in Shopify admin.
  3. 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.

    An example of an unedited two-part product title in Shopify admin.

    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.

    An example of an edited product title in Shopify admin.
  4. Repeat the previous steps to edit the two-part titles for all applicable products.

# Define a product metafield

  1. 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.

    The Settings menu in Shopify admin.
  2. On the Metafields page, select Products, and then choose Add definition.

    The Products metafield definitions page in Shopify admin.
  3. 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.

    The metafield name text entry box in Shopify admin.
  4. In the Namespace and key box, replace the text my_fields with label_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.

    The metafield key and description text entry boxes in Shopify admin.
  5. Choose Select content type.

    The Select content type button on the metafield definitions page in Shopify admin.
  6. From the dropdown list, select Text.

    A list of content types on the metafield definitions page in Shopify admin.
  7. Set the checkbox to select Single line text.

    The Single line text content type selected on the metafield definitions page in Shopify admin.
  8. 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:

  1. In your Shopify admin, select Products, and then choose a product from the Products list.

  2. At the bottom of the page, locate the Metafields area.

  3. 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.

    Example values in the metafields area of a product page in Shopify admin.
  4. Select Save.

  5. 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:

  1. In Theme Editor, go to Theme settings > Products.

    The Theme settings menu in Theme editor.
  2. Locate the Additional metafield menu area.

    Note

    Refer to Products.

  3. 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.

    The metafield text entry box inside the Theme settings Product menu in Theme editor.
  4. 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.

    The metafield checkbox options inside the Theme settings Product menu in Theme editor.
  5. Visit the corresponding store page to verify that the metafield displays correctly.

    An example product page with a custom metafield.

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.