Thread tagged as: Question, Docs

Setting and maths on variables in a template?

I want to be able to check if certain fields exist on page and create and add to a variable for making some later decisions further down the code in a template. For example ...

<perch:if exists="productLargeImage1" OR "productLargeImage2" OR "productLargeImage3">
    (set some variable to 1)
<perch:if exists="productLargeImage1" AND "productLargeImage2" AND "productLargeImage3">
    (set some variable to 3)

Or set the variable initially to zero and increment or decrease it as I check specific fields have values in them. I can't see such a facility or variable. Please point me to one if there's something I've not spotted in the documentation.

Thanks, Graham

Graham Street

Graham Street 17 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Nope, we don't have that.