How do I create a new object in Ariadne from a template?The Ariadne pobject from which other objects are derived has a factory method: newobject() and a save() method.
If I want to create an object under this FAQ section (a pdir in Ariadne), I can put this in a template on the pdir:
$z->setValue("name","new faq by prog","en");
Note that I had already previously created a new type of object (ppage.faq) using a typetree.ini template. The "en" on the setValue call sets the English language value for object attribute "name" to "new faq by prog". If you leave off the language designation you won't see the value in the multi-language object editors in the Ariadne admin UI.
look in lib/objects/ariadne_object.php for pobject's code. ariadne_object.php defines class ariadne_object, derived from class object, and from which class pobject is derived.
Add a Comment
NOTE: Comments are moderated and will not show until approved.