New answers tagged craft5
0
votes
can I 'switch' entry types rather than using if statements?
If your projectData is static, I would not use case, in this case.
{% set projectData = {
'clients': entry.clients.all(),
'partners': entry.partners.all()
} %}
{% for key, data in projectData ...
0
votes
How to query variants for structured products (commerce 5.2) to sort products
Tweak your code a bit. Instead of using hasProduct, which can jumble up the order, call variants on each product as you loop through:
// grab current category to filter products
{% set currentCategory ...
0
votes
can I 'switch' entry types rather than using if statements?
I figured this out — with a steer from the help here and also Ryan Irelan's article
Seems I needed to 'gather' my entry types before running the switch... I'm sure there's other ways to achieve this, ...
0
votes
can I 'switch' entry types rather than using if statements?
If the switch can be made based on entry.type, I might suggest:
a separate twig template for each entry type.
one template as an entry point.
I assume this is the situation
you have 2 entry types: ...
2
votes
can I 'switch' entry types rather than using if statements?
Yes, you can. Switch is not native to Twig, but Craft adds its own switch tag to the language, as per the Tags documentation here, which works exactly as you have demonstrated: https://craftcms.com/...
0
votes
“email: Unable to save user:” Craft Solo & Commerce 5: Guest Checkout fails
I imagine a 'Guest' in this context is simply an un-priveleged, un-authenticated user, against which the order is stored. Not sure how else Craft would be able to create an order, if not against a ...
Top 50 recent answers are included
Related Tags
craft5 × 67matrix × 9
craft4 × 5
plugin-craftcommerce × 4
frontend-form × 4
plugin-sprig × 4
templating × 3
plugins × 3
control-panel × 3
modules × 3
migration × 3
graphql × 3
upgrades × 3
ckeditor5 × 3
entries × 2
assets × 2
relations × 2
entry × 2
php × 2
field × 2
redactor × 2
controller × 2
entry-type × 2
updates × 2
sorting × 2