4

Instead of duplicating the entries, you could run your entries loop twice (or as many times as you want) maybe? {% for i in 0..1 %} {% for entry in entries %} {{ entry.title }} <br> {% endfor %} {% endfor %}


3

you can use the instance of twig test here. You want to flip your logic, so test for Query object first else array stuff but this should work I think. To get the specific class just {% dd props.cards %} in the template for ease.


2

In Craft 3, hasURL() is part of a section's siteSettings() as a section exists in multiple sites and can have URLs in one site but not another. If you are not using multi-sites, a drop-in replacement for your code would be: {% for section in craft.sections.getAllSections() %} {% for sectionSettings in section.siteSettings %} {# We only care about ...


2

I'm not sure I can tell you much more than the error messages are telling you, you need to update your twig code eg. in index.twig (line 6) where it says; getPurchasableId() change it to getId(). These errors are just warning you that a future version of Craft won't support them (I imagine it will be Craft 4, but could be sooner). Changing e-commerce ...


2

For your first issue, if you are not paginating then your {% else %} should be: {% set pageEntries = entries.all() %} So that the query gets executed. In full: {% if pagination is defined and pagination == true %} {% paginate entries as pageInfo, pageEntries %} {% else %} {% set pageEntries = entries.all() %} {% endif %} Regarding ...


1

You don't mention what your related entries field handle is, but remember that calling any related element (entries/assets/categories/users/tags) will require a .all() (or .one() or .ids() or one of the other query-executing methods) unless the related elements are eager-loaded. With that in mind I can't see anywhere in your code where you're executing a ...


1

You should replace craft.fields.getFieldbyHandle() with craft.app.fields.getFieldByHandle() (note the additional .app in there).


1

If you have a custom module/plugin, you can register a Twig extension, and then your class would look something like this: <?php namespace my\plugin\twigextensions; use Twig\Extension\AbstractExtension; use Twig\TwigFilter; use Twig\TwigFunction; class MyTwigExtension extends AbstractExtension { /** * @inheritdoc */ public function ...


1

I've run into something similar before and usually what I have to do is dig into the compiled_templates folder and look in the file(s) that are mentioned in the stack trace to get an idea of which bit of code it's complaining about. From your stack trace, I'd try looking at line 52 of storage/runtime/compiled_templates/38/...


Only top voted, non community-wiki answers of a minimum length are eligible