I'm trying to set the URL of my product entry's to be dynamically created based on 3 category fields and 2 number fields. The category fields are required, but I need to add some logic for the number fields.
It's all taking up so much space that upon saving the section's settings, the URL Format field cuts off some of my code. I'm sure there is a great reason that this field has a character limit so is there anything else I can do? I tried importing a macro, but couldn't get that to work. Do I have to create a plugin?
This is the content I need to use in my Entry URL Format that is too long with my variable names:
some-text-here/{%if object.mfgCategory.first.slug=="1hack"%}hack{%else%}{mfgCategory.first.slug}{%endif%}-{%for c in object.series%}{c.slug}-{%endfor%}{sizeCategory.first.slug}-{%if object.num1=='0'%}00{%else%}{number1}{%endif%}-{%if object.number2=='0'%}00{%else%}{number2}{%endif%}