Creating attribute without a package

Permalink
Hi,
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.

Thanks

 
shahroq replied on at Permalink Reply
shahroq
Hi,
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
Hi,
Dont I need $pkg for that?
Can you please post some code sample for that?
Thanks!
IceManSpy replied on at Permalink Reply
IceManSpy
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:https://www.concrete5.org/marketplace/themes/fruitful...

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