Insertelement

From PunchCMS
Revision as of 15:06, 3 May 2009 by Admin (Talk | contribs)

Jump to: navigation, search

InsertElement Methods

setTemplateName (apiName)

Set the name of the template the element should be based on.

setActive(active)

Set the element on active (1) or inactive (0).

setName (name)

Set the element name. This will be the name in the CMS.

setUsername (name)

Set the name of the element creator. Used to indicate that the element was created by a website visitor.

addField (apiName, value, [languageId])

Add a field value by field name. The value will be inserted for the default language if not specified otherwise. //

save ()

Write the element to the CMS. Returns the newly created element.