There are multiple ways to achieve this behavior.

  1. Use Blog Posts (Online Store -> Blog Posts), and make sure the article has the same handle as the corresponding collection, then get article content inside the collection template like this (we're using "news" as the blog title in this example):
{% for article in blogs["news"].articles %}
  {% if article.handle contains collection.handle %}
    {{ article.content }}
  {% endif %}
{% endfor %}
  1. Use Pages (Online Store -> Pages), and make sure the page has the same handle as the corresponding collection, then get the page content inside the collection template like this:
{{ pages[collection.handle].content }}
  1. Use collection descriptions. In Products -> Collections you can add your content in the description field, and access it in collections like this:
{{ collection.description }}
Answer from cMarius on Stack Overflow
🌐
Shopify
shopify.dev › docs › api › liquid › objects › page
Liquid objects: page
To learn about how to create ... the Shopify Help Center. ... A timestamp for when the page was published. ... Use the date filter to format the timestamp. ... The name of the custom template assigned to the page. The name doesn't include the page. prefix, or the file extension (.json or .liquid). If a custom template isn't assigned to the page, then nil is returned. ... The title of the page. ... The relative URL of the page. ... "content": "<p>Polina's ...
🌐
Shopify
shopify.github.io › liquid-code-examples
Shopify Liquid code examples
There is a limit of 50 products per page, after which pagination will automatically occur.collections · Commenting on blogs is an optional setting which can be enabled from the main Shopify admin. This code component will display a list of blog comments for a specific post or article.blog · Copyright text is typically displayed in the footer section of an online store, and provides a clear indication of a copyright symbol, the year of creation and author of the content.
🌐
Shopify
shopify.dev › docs › api › liquid
Liquid reference
Tags are wrapped with curly brace percentage delimiters {% %}. The text within the delimiters is an instruction, not content to render. In the example to the right, the if tag defines the condition to be met. If product.available returns true, then the price is displayed. Otherwise, the “sold out” message is shown. ... To nest multiple tags inside one set of delimiters, use the liquid tag.
🌐
Shopify
shopify.dev › docs › api › liquid › objects › pages
Liquid objects: pages
Skip to main content · Collapse sidebar · Liquid · Copy page MD · All of the pages on a store. Access · Global · You can access a specific page through the pages object using the page's handle. Code · Reset Code · 9 · 1 · 2 · {{ pages.contact.title }} {{ pages['about-us'].title }} {{ pages.contact.title }} {{ pages['about-us'].title }} 9 ·
🌐
Ed
ed.codes › blog › output-page-content-in-custom-liquid-sections-in-shopify-2-0-using-metafields
Output Page Content Anywhere on Your Shopify Store Using Custom Liquid Sections | Ed Codes
November 16, 2022 - If you want to add page content absolutely anywhere in your theme, you can always do so using the Custom Liquid block.
🌐
Shopify Community
community.shopify.com › store design
How can I successfully insert liquid code into page content on ...
January 22, 2019 - I’m two weeks into learning about Shopify, liquid, and theme modification. Using the theme called ‘Supply’. I added a new page for vendors. In the page content area, you can see I added vendor images (photo#1) and then I chose to add to the page content (toggle view into html mode, photo#2) and added basically the same html this theme uses to format collections (section/collection-template and snippets/product-grid) to format my vendor logos.
🌐
Shopify
shopify.dev › docs › storefronts › themes › architecture › templates › page
page
The page template is located in the templates directory of the theme: ... You can access the Liquid page object to display the page details.
Find elsewhere
🌐
Shopify
shopify.dev › themes › architecture › templates › page
page - Shopify.dev
The page template is located in the templates directory of the theme: ... You can access the Liquid page object to display the page details.
🌐
Shopify
shopify.github.io › liquid
Liquid template language
Liquid is an open-source template language created by Shopify and written in Ruby. It is the backbone of Shopify themes and is used to load dynamic content on storefronts.
🌐
Markdunkley
cheat.markdunkley.com
Shopify Cheat Sheet - Liquid variables
Returns this article's content (the actual article). ... Returns the date/time of when this article was created. ... Returns the date/time of when this article was last published. Different from article.created_at if you import blog posts or hide/show a blog post. ... Relative url where the blog can be found. Will append #article-id as anchor so that the page should automatically scroll to the corresponding article.
🌐
Shopify
shopify.github.io › liquid › basics › introduction
Introduction – Liquid template language
Liquid uses a combination of objects, tags, and filters inside template files to display dynamic content.
🌐
Shopify
shopify.com › partners › blog › landing-page
How to Use Liquid to Create Custom Landing Page Templates - Shopify
Once the section tags for the three sections we created are added, the page.fall-landing-page.liquid template will look like this: Now when your client is creating their landing page, they can choose the specific landing template they need from the admin: Another option to consider for designing landing pages is to remove the header navigation and footer from the page. This reduces the number of options visitors have, and places focus instead on the page content and call to action.
🌐
Shogun
getshogun.com › learn › shopify-liquid-tutorial
Shopify Liquid Tutorial: Edit Shopify Theme Code Like a Pro
July 19, 2024 - Static content stays the same from page to page but dynamic content changes. In your Shopify store, static elements are written in HTML, and dynamic elements are written in Liquid.
🌐
Shopify
shopify.com › partners › shopify-cheat-sheet
Shopify Cheat Sheet — A resource for building Shopify Themes with Liquid
Returns the URL of the previous product in the collection. Returns nil if there is no previous product. This output can be used on the product page to output ‘next’ and ‘previous’ links on the product.liquid template.
🌐
EComposer
ecomposer.io › blogs › news › shopify-custom-liquid-section
Ultimate Guide to Add Custom Liquid Section in Shopify - EComposer
- In your Shopify’s theme editor, ... navigate to “Custom Liquid” and select it. ... - Add your Custom Liquid code to define the content and structure of the section. This can include HTML, CSS, and Liquid tags....
Rating: 5 ​ - ​ 2.15K votes
🌐
Chris the Freelancer
christhefreelancer.com › shopify-liquid-guide
Shopify Liquid - The Ultimate Guide
February 28, 2023 - A comprehensive guide to Shopify Liquid Programming, the templating language used in Shopify themes for loading dynamic content into your online store.
Top answer
1 of 2
1

According to Shopify schema, a page is something with the url as follow - //mystorelink.com/pages/page-handle . So when you use {{ page.title }} it will display the page title only when the url is in the above format.

Don't confuse between a "Shopify page" and a "webpage" for both are completely different.

A Shopify page is a template while a webpage is a normal html page. In order for your requirement refer to following link types and templates

  1. / or //myshoplink.com -> index.liquid -> {{ page_title }} & {{ page_description }}
  2. /collections/xyz -> collection.liquid -> {{ collection.title }} & {{ collection.description }}
  3. /products/xyz or /collections/abc/products/xyz -> product.liquid -> {{ product.title }} & {{ product.description }}
  4. /pages/xyz -> page.liquid -> {{ page.title }} & {{ page.description }}

etc similarly for other templates.

P.S. You can have multiple product/collection/pages etc. templates using suffix values, but {{ <template>.title }} remains the same

P.P.S. If nothing is to be changed you can plainly use {{ page_title }} and {{ page_description }} everywhere. It defaults to the template currently in use.

2 of 2
0

For the benefit of anyone else, here is a more comprehensive testing snippet for finding identifiers to use in Liquid conditionals, based on the accepted answer:

<div class="grid__item__nm--wrap">
    <span><h1>THIS IS WHAT THE SHOPIFY PAGE TITLE IS:</h1> {{ page.title }}</span>
    <span><h1>THIS IS WHAT THE SHOPIFY PAGE HANDLE IS:</h1> {{ page.handle }}</span>
    <span><h1>THIS IS WHAT THE SHOPIFY PAGE TEMPLATE SUFFIX IS:</h1> {{ page.template_suffix }}</span>
    <span><h1>THIS IS WHAT THE SHOPIFY PAGE ID IS:</h1> {{ page.id }}</span>
    <span><h1>THIS IS WHAT THE RENDERED PAGE TITLE:</h1> {{ page_title }}</span>
    <span><h1>THIS IS WHAT THE RENDERED PAGE META DESCRIPTION IS:</h1> {{ page_description }}</span>
    <span><h1>THIS IS WHAT THE SHOPIFY COLLECTION TITLE IS:</h1> {{ collection.title }}</span>
    <span><h1>THIS IS WHAT THE SHOPIFY COLLECTION HANDLE IS:</h1> {{ collection.handle }}</span>
    <span><h1>THIS IS WHAT THE SHOPIFY COLLECTION ID IS:</h1> {{ collection.id }}</span>
    <span><h1>THIS IS WHAT THE SHOPIFY COLLECTION DESCRIPTION IS:</h1> {{ collection.description }}</span>
    <span><h1>THIS IS WHAT THE SHOPIFY PRODUCT TITLE IS:</h1> {{ product.title }}</span>
    <span><h1>THIS IS WHAT THE SHOPIFY PRODUCT HANDLE IS:</h1> {{ product.handle }}</span>
    <span><h1>THIS IS WHAT THE SHOPIFY PRODUCT ID IS:</h1> {{ product.id }}</span>
    <span><h1>THIS IS WHAT THE SHOPIFY PRODUCT DESCRIPTION IS:</h1> {{ product.description }}</span>
</div>
🌐
BSSCommerce
bsscommerce.com › blog › shopify tutorials › what is shopify liquid and how does it work?
What is Shopify Liquid and How Does it Work?
October 30, 2023 - With the help of liquid, any type of dynamic content can be shown on the Shopify store. With this, you will be in a position to show product info, collections, blog posts among others dynamically on your site.
🌐
Wecanflyagency
wecanflyagency.com › blog › what-is-shopify-liquid
What is Shopify’s Liquid and where can you learn about it? | wecanfly
The primary function of Liquid is to load dynamic content onto online stores, which means that users have extensive control over how their product images, text, and other relevant details are displayed.