Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello there,
I have quick add buttons at my homepage in my featured collection. Now, i also want these buttons in each column of my multicolumn section on my other page. Not quick add buttons but just normal buttons which will lead to another page. I tried to find the solution and got to a button by coding, but couldn't figure out how to customize this button so its the same as the others, and how to add a link to it. Can you help me out?
Hi, could you share the code you’re currently using for your custom buttons? Also, could you provide a link to your site? I’d be happy to take a look.
autoBlogger: Seamlessly scheduled, fully automated, AI-powered, and SEO-optimised blogging with a host of free extras! Start your 14-day free trial today!
I tried to use this code in the multicolumn.liquid code:
{% if block.settings.title_button != "Hide" %}
<a {% if block.settings.url_button != blank %} href="{{ block.settings.url_button }}"{% endif %} class="button button--primary" role="link">
{{block.settings.title_button}}
</a>
and also this in the same code but in the schema:
{
"type": "text",
"id": "title_button",
"default": "Test",
"label": "Button Text"
},
{
"type": "url",
"id": "url_button",
"default": "/",
"label": "Button Link"
}
But this made all the buttons black with a white text. I think it has something to do with the class? But i dont know how to do that and where i can find this.
The is the preview link:
https://www.madamecharlie.nl/?_ab=0&_fd= 0&_sc=1
I want the buttons in the columns at 'our pastries'
but now i can not get this to work either, i think i am messing up the place of the code
I think it has something to do with the 'outline' option of the buttons. I just saw if i dont have this checked, all the buttons on my site will look black/white, and if i do have it checked it will look like how i want them to. But when i did got the code to work a few days ago the option for this checkbox did not show.
Jup thats the case, i just checked with my other buttons. So now i just need the buttons to show and to have that option to get them outlined!
Hey
Give this a go:
{% if block.settings.title_button != "Hide" %}
<a
{% if block.settings.url_button != blank %}
href="{{ block.settings.url_button }}"
{% endif %}
class="button button--secondary"
role="link">
{{ block.settings.title_button }}
</a>
{% endif %}
(Changing button--primary to button--secondary)
Let me know if you are still having problems, and we can troubleshoot further.
autoBlogger: Seamlessly scheduled, fully automated, AI-powered, and SEO-optimised blogging with a host of free extras! Start your 14-day free trial today!
so only this code? and where do i put this? multicolumn.liquid code?
It works! thanks! Just the following thing, now all of my multicolumns have a button... Can i hide the button for certain multicolumns? For all of these...
I got the buttons to hide but the columns are not square anymore. Like the buttons are still there but not showing (thats what i want but i also want the columns to be square.
Mr Ollie?
Dropshipping, 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, 2024In today’s interview, we sat down with @BSS-Commerce to discuss practical strategies f...
By JasonH Nov 13, 2024