Get an entity object.
entity [reference [site [:if-exists y-action] [:if-does-not-exist n-action]]]
Get the entity that matches the reference on the site. The reference can be an entity reference (preferable), a string a keyword. Returns the entity currently generated if the reference is NIL or not provided. Searches the current site for the entity if the site argument is not provided. If a site argument is provided, it should be a valid argument to site.
The keywords control what happens if the entity already exists or does not yet exists. If the if-exists is :error, an error is signalled if the entity already exists. If the if-does-not-exist is :create, the function returns a newly created entity instead of NIL if a matching entity doesn't exist.
The object returned is of type entity, and can be used as argument in constructs such as with-open-dom.
(entity "footer")
(entity "news" NIL :if-does-exists :error :if-does-not-exist :create)
Interaction Developer Reference