Difference between revisions of "Insertelement"

From PunchCMS
Jump to: navigation, search
(New page: === InsertElement Methods === ==== setTemplateName (apiName) ==== Set the name of the template the element should be based on. ==== [[Insertelement/setact...)
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 +
__NOTOC__
 
=== InsertElement Methods ===
 
=== InsertElement Methods ===
 
==== [[Insertelement/settemplatename|setTemplateName (apiName)]] ====
 
==== [[Insertelement/settemplatename|setTemplateName (apiName)]] ====
Line 9: Line 10:
 
Set the name of the element creator. Used to indicate that the element was created by a website visitor.
 
Set the name of the element creator. Used to indicate that the element was created by a website visitor.
 
==== [[Insertelement/addfield|addField (apiName, value, [languageId])]] ====
 
==== [[Insertelement/addfield|addField (apiName, value, [languageId])]] ====
Add a field value by field name. The value will be inserted for the default language if not specified otherwise. //
+
Add a field value by field name. The value will be inserted for the default language if not specified otherwise.
 +
 
 
==== [[Insertelement/save|save ()]] ====
 
==== [[Insertelement/save|save ()]] ====
 
Write the element to the CMS. Returns the newly created element.
 
Write the element to the CMS. Returns the newly created element.

Latest revision as of 15:06, 3 May 2009

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.