This feature was started in Tiki5 and will be more & more used in Tiki6

Attributes should be used to create cross-feature functionality.

Attributes

To implement transversal features such as geolocalization of objects in tiki, Object Attributes were introduced. Not unlike user preferences, they are key-value pairs stored in the database and are associated to the type and itemId (same as object permissions).

To avoid the inconsistencies seen in the preference naming conventions, the attribute library enforces a few conventions.

  1. Attribute names may only contain lowercase letters and dots.
  2. Two levels of scoping are required. First level for bundled attributes must be tiki. Custom extensions can use an other prefix. Second level must be some sort of package name. The rest is up to the implementor.


Valid attributes would be tiki.geo.lat or tiki.geo.lon

Library code is located in lib/attributes/attributelib.php. The library allows to:

  • Get all attributes for an object as a map using get_attributes().
  • Set a single attribute on an object using set_attribute().


Because all values are fetched at once, the length of the content must remain small. The limit of the size of attribute and relation names is 25 characters.

Current attribute usage in the tiki.* namespace


Please document namespace use here as you start using new attributes in Tiki features

AttributeUsage
tiki.article.*Custom attribute fields for articlesNot appropriate! Attributes should be applicable to all object types
tiki.comment.rangesRange information for annotatorjs for inline comments (since 17)
tiki.content.urlFile gallery files location of remote content
tiki.content.expiresFile gallery files expiration of remote content
tiki.content.lastcheckFile gallery files last check time of remote content
tiki.content.sourceSame as tiki.content.url if not a "reference"?
tiki.content.etag File gallery files etag of remote content
tiki.geo.latLatitude coordinate of the object
tiki.geo.lonLongitude coordinate of the object
tiki.geo.google.zoomZoom level of an object used in Google Maps
tiki.icon.srcIcon url for object such as trackeritems
tiki.object.lockUsername of who locked the object (since 15)
tiki.object.imageUsed in forums?
tiki.object.layoutPage layout to be used (used in wiki pages)
tiki.proposal.accept Proposal plugin +1 vote
tiki.proposal.undecided Proposal plugin 0 vote
tiki.proposal.reject Proposal plugin -1 vote
*.rating.overrideRatings?
tiki.relation.targetLabel to be used when referring to the target of a relation
tiki.relation.sourceLabel to be used when referring to the source of a relation
tiki.sync.providerRemote tracker sync providor
tiki.sync.sourceRemote tracker sync source
tiki.sync.lastRemote tracker sync last sync time
tiki.tracker.pretty.views Invalid and probably unused (from r34097)
tiki.wiki.autotocOverride the global pref for autotoc per wiki page
tiki.wiki.page_hide_titleOverride the global pref for show title per wiki page
tiki.wiki.namespaceNamespace of a wiki page

Relations

The Object Relations allow to qualify a relationship between any two objects in the system or with external resources (URLs). Just like attributes, the qualified name of the relationship must be scoped.

Relations are managed with lib/attributes/relationlib.php.

Because all values are fetched at once, the length of the content must remain small. The limit of the size of attribute and relation names is 25 characters.

Current relation usage in the tiki.* namespace

Please document any relations used in Tiki features here

Relation Usage
tiki.article.attribute Relationship between an article type and its related custom attribute fields
tiki.article.attach Used in the Articles tracker field to attach articles to a tracker item
tiki.file.attach Attaches File Gallery files to objects (tracker items so far?)
tiki.friend.follow used by the friends feature to indicate a friendship/following relationship
tiki.friend.request used by the friends feature to indicate a request to be friends
tiki.general.related Any generic relationship not specific to any feature/module
tiki.link.$type Links wiki pages ($types are probably semantic etc)
tiki.mustread.complete Used by the Must Reads feature to indicate that a Must Read is complete
tiki.mustread.required Used by the Must Reads feature to indicate that a Must Read is required by a user
tiki.mustread.comment Used by the Must Reads feature to indicate that a Must Read is requires a comment by a user
tiki.mustread.respond_privately Used by the Must Reads feature to indicate that a Must Read needs a private reply by a user
tiki.mustread.circulation Used by the Must Reads feature to indicate that a Must Read requires a user to circulate it
tiki.social.like used by PluginLike for liking of objects
tiki.source.creator used by PluginInsert to keep track of which page created the Tracker Item via this plugin
tiki.sheet.$type Relates sheets and trackers
tiki.user.favorite Links users to favourite objects (wiki pages only so far?)
tiki.user.banned To ban users from objedcts (groups initially for 8.x could be extended)
tiki.wiki.linkeditem used by the Wiki tracker field type to link a wiki page with a tracker
tiki.wiki.linkedfield used by the Wiki tracker field type to link a wiki page with a tracker


A smarty tag like this will show a link to the object that is at the target end of the relation. The text of the link will be the "tiki.relation.target" attribute set for that relation (i.e. the attribute for an object of type 'relation' and relationId, if any. If there is no such attribute set for that relation, then it will show the usual link as per the normal behavior of the object_link tag.

Copy to clipboard
{object_link type=relation_target id=x}



alias

Show PHP error messages
 
ERROR (E_WARNING): Trying to access array offset on null
At line 298 in temp/templates_c/en_social^51ed9d5e273be5e76d0e990a7170327cc292754c_0.file_tiki-show_page.tpl.php