All things Shopify and commerce
Using the Dawn theme, I know I can hard-code text on the Login page by editing the main-login.liquid file but how can I edit this text later without having to edit the liquid file? How can I add a custom field so that I can change the text later through the Shopify admin? So If I have add this code:
<p> Enter your credentials and select the "Sign In" button to access your account. </p>
How can I edit that later without having to edit the liquid file? I do see fields in the "Theme Content" settings for the Accounts (classic) Login page which would be the perfect spot for this.
To make the text on your login page editable without modifying the Liquid file directly, you can add a custom field to the Theme Content settings through Shopify's Custom Fields. Here's how you can do that:
You can add a custom field in the settings_schema.json file to make it editable from the admin. Here's an example of how to add a text area setting:
Now, in your main-login.liquid file (or wherever you want the text to appear), use the following code to pull the custom text from the settings:
<p>
{{ settings.login_page_text }}
</p>
After you've added the setting and updated the Liquid file, you'll be able to change the text from the Shopify Admin:
Now, you can modify the login page text directly from the Shopify Admin without needing to access or modify the Liquid files again.
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024