We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [dry]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
0answers
90 views

I'm repeatedly setting the same variables. How to reuse code block to make this DRY?

I have a very complex layout which is requiring me to have quite a few {% for %} loops on the page and in each loop I need to set a bunch of variables. In order to make my template more DRY I was ...
0
votes
0answers
52 views

Error Icon and DRYer Code

I currently have the following code as part of the address form in Craft Commerce. <label class="label" for="{{ modelName }}-firstName">First Name (*)</label> <input ...
1
vote
1answer
64 views

Logistics of loose field naming and re-use with Relabel

Relabel certainly seems quite useful in being able to apply a more generic use to fields. The more I use it the more I see a use case for just creating a generic field with the same name as it's ...
2
votes
1answer
578 views

Possible to re-use one field multiple times in a section?

This seems like it should be possible but I may be missing a trick. Is it possible to use a single field multiple times in a section? So, for example, if you have a simple 'text' field and you want ...