What Is This?
This is a custom mulit-line text field that enables you to add custom content to your article's sidebar.
This is useful for when you want to display different sidebar content in every article. However, if you want to display the same sidebar content in every article, you don't have to use this metafield. Instead you can supply the content directly in the "Content" setting within the "Sidebar" block on the Main Article section.
How Do I Set This Up?
Create the Metafield
- From your Shopify admin, go to Settings > Custom data.
- Select Blog posts.
- Click Add definition.
- In the Name field, enter "Sidebar Content". The Namespace and key field will automatically generate as "custom.sidebar_content", don't edit this.
- Optional: In the Description field, enter a description for your metafield value
- Click Select content type, and then select Multi-line text.
- Click Save.
Shopify provides details about creating metafields here
Supply Data for the Metafield
- From your Shopify admin, go to Online Store > Blog Posts
- For every article, select it and scroll to the bottom of the page where you will see the metafield you added in the first set of instructions. Select that field and enter the content you want to display in each article's sidebar.
Display the Metafield Data on your Site
Only one section enables you to display this sidebar content. Follow the instructions below.
-
- This section has a block called "Sidebar". Once you've added or navigated to this section on your article page template, click "Add Block".
- Select "Sidebar"
- This block has a setting called "Content". For this setting, click Insert Dynamic Source (icon) > Show More (if applicable) > Sidebar Content
-
-
-
Learn More about connecting items dynamically here
-
-
-
-
- If you've followed all of the instruction sets above, and you've supplied data for the article you're currently previewing, then you will see your Sidebar content display.
Comments
0 comments
Please sign in to leave a comment.