Hey so I see that in the documentation I can programmatically add Attributes to Express Objects when they get created, however I need a way to programmatically add Attributes to existing Express Objects. As in… without removing/re-creating the Express Objects.
When you visit Concrete github account, there is a “migration_tool” package there.
Install package appropriate to your Concrete version and play with it a little.
It allows you both import and export Concrete stuff (pages, attributes, files and many more).
The point is, that “Migration tool” will create xml file that holds information about your Express object (which can be used instead writing a lot of php code).
Export your Express object and download generated xml file.
You can trim stuff that you don’t need.
For example this one will insert text attribute to entity.
Export/Import really isn’t what I’m seeking here, as that generally implies an outage, and I don’t see how that really is what I’m talking about, which is adding Attributes to the existing Express Object without re-creating it. I’m roughly trying to build out a DevOps workflow here, to say in short-form, and this is one of the areas I haven’t found a workable solution for.
But the proposed method looks to be substantially more complicated just because the intent is to add the Attribute after the Express Object has been made. Surely there’s a more simple way…?
Well, you can get the same results writing more PHP code if you want. It doesn’t matter how do you add it.
But you will probably have to do it by yourself, because it seems that Express::buildObject() is written in a way to only create fresh Express object, not use existing ones.
Oh wow thanks! I think I see how that works… it kind of… re-inits the Builder functionality and then lets you work with it again! I suspect that may be unintended by the devs, but oh well!
I’ll have to try that when I get a chance Again, thanks!