Forum

Thread tagged as: Question, Suggestions

The default attribute doesn't work in page attribute templates.

I don't know if this is a bug or if it's intentional, but I've noticed that the "default" attribute doesn't work in page attribute templates (for example, the seo.html template that comes with Perch).

It'd be nice if it did, so we can provide some solid defaults for meta descriptions and keywords. I was able to achieve something similar using the <perch:if exists=""> tag, but it's not quite as clean as using the default attribute would be:

<perch:pages id="description" label="Description" type="textarea" size="xs" escape="true" default="sensible default page description" />
James Harrison

James Harrison 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

I think it may be that it's a textarea type.

I tried switching it to text and I still didn't see the default output if I left the fields blank. I guess wrapping the <perch:if exists=""> works well enough, I just assumed the default would work (and be cleaner code too).

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, I would have thought that too. I'll look into it.