Package checking if certain areas exist? (5.6)

Permalink
Is there a way to make sure certain area names exist before installing a package?

I want to ensure several area names exists so I can throw an exception before calling parent::install(); in the package controller.

There doesn't seem to be a consistent area naming convention, but I would like to ensure say Main and Sidebar exist (and maybe create them if necessary).

Any help/code samples would be appreciated,

John

jasteele12
 
jasteele12 replied on at Permalink Reply
jasteele12
Nobody?
ramonleenders replied on at Permalink Reply
ramonleenders
How do you mean, they exist? There are several page types you can have, and are you talking about pages yet to be made or for existing pages? If you tell us what you're trying to achieve exactly, we may have a better view on it.
Mnkras replied on at Permalink Reply
Mnkras
The easiest thing would be to just do a select unique/count from the Areas table on arHandle,

This isn't for performance, so it shouldn't be a big issue,

But since areas are per page you might want to do some checking Page's Page Template (since that is what usually declares the areas)

Just remember, there are areas can exist, but never be displayed.