Creating attribute without a package

We create our theme metadata keys very often.
I want to create new attributes programatically without having the need to install them.
Meaning on the fly and not by a package.

The main reason is that we want our theme to be portable between environments, so when a developer update his source from the source control he will get the attributes without the need to install them or create them manually.


View Replies:
shahroq replied on at Permalink Reply
Adding the code inside on_start() method of your theme controller should do that. Also add a check if that attribute already exist before create new one.
fatnjazzy replied on at Permalink Reply
Dont I need $pkg for that?
Can you please post some code sample for that?
IceManSpy replied on at Permalink Reply
You can create package with your theme.
That would be better, beacuse if you need create custom template for block, you can do this !
If you have only theme - you can't .

Check f.e. this theme:

It has simple controller for package and author add custom attribute to theme.