Closed silveltman closed 2 years ago
Turned out you have to pass at least 1 argument.
Also, the tag where you call bookshop should be on 1 line.
Interesting โ This as a bug, the tag would ideally support no arguments, as well as splitting onto multiple lines. I'll reopen this and look at fixing it in the coming weeks ๐
Your answer got me thinking, when not passing in an argument, shouldn't the value in the .toml file be used as a default? Or is that just the case when adding a component via the CMS
Right now the arguments that are not passed are just blanc
Currently, the .toml
files are only relevant for the CMS. Since Bookshop tries to not be less involved in rendering the includes, there's nothing in the production flow that loads those config files.
It's something that could be considered, but it would need to have another syntax to explicitly opt-in to.
Once I got a bit more used to Bookshop it actually makes sense to me that the .toml is only used in the CMS. I think adding something like this would add less value than I initally though. When wanting a default value it's probably better to hardcode that value in the component itself in most cases
Hi @silveltman, the 2.6.0 release includes fixes for Bookshop components that take no arguments, and tags that span multiple lines ๐
Both of your initial examples should work correctly now.
I've set up bookshop and made some components, all without problems. However, when I try to use a component on a page I get a "object null is not iterable" error. In the component browser it all works fine
index.liquid:
The commented "button" component is what I eventually try to achieve, but I decided to test it with different (more simple) components too. Alays the same error... I also tried it without the commented section, so that's not the problem.
DEBUG output:
cta.liquid:
cta.toml: