APC Action Applications - Home Page

Frequently Asked Questions v2

 

The concept of Tagged IDS is simple - when we store an id in a field, we sometimes want to say something about it. the idea came from the directional/bidirectional links which in fact are not stored like that, but are used internally to store one or two uni-directional links.

A tagged id consists of some string followed by 24-32 hex digits. (It should be 32, but there are some buggy shorter ids due to old bugs in apc-aa). Typically the string will be a single letter g-zA-Z or a punctuation character.

Tagged id's may not be supported everywhere yet. They are supported ....

In zids.php3, which means that most other places in the code can trivially support them transparently.

In the Slice Admin -> Fields you can set a field to Relational Window, and then use hte parameter wizzard to set which buttons to use (a set of letters matching the values of the tag), then add an extra parameter (not yet supported by the wizzard) that refers to a table.

The table is in the $tps array, defined in itemfunc.php3, if you want to use anything other than the two standard ones "AMB" (Add, Mutual, Backwards) and GYR (Good, OK, Bad) then you need to somewhere in your code do something lke

$GLOBALS[tps][MyTable] => array (
G => array ( prefix => 'Good:', tag => 'x', str => _m("Good") ),
Y => array ( prefix => 'OK :', tag => 'y', str => _m("OK") ),
R => array ( prefix => 'Bad :', tag => 'z', str => _m("Bad") ));

In the Relational window, if you have specified a table, then it will be shown as buttons - just the ones picked in the second parameter.

THIS USED TO WORK, BUT SOME CHANGE TO THE CODE BY SOMEONE ELSE HAS BROKEN IT,, AND I DON'T HAVE TIME TO FIX IT.

Note that the "tag" from this field is what is stored.

You can then use this tagged field in many ways, for example it can form part of a search string, to look for only "Good" links, or you could use a switch statement to figure out how to use it.

You should NEVER have to write code in your site to strip the tag away from the value, for example if you pass a tagged id to e.g.
view.php3?vid=123&cmd[123]=x-123-z1234567890abcdef1234567890abcdef
then view.php3 SHOULD understand this correctly as refering to item 1234567890abcdef1234567890abcdef

A new pseudo-field is created idtag........... contains the tag anywhere that GetItemContent is used to get the fields (i.e. should be everywhere). So you can put {switch({idtag...........})x:GOOD} into your code.

Last Edit: Aug 17 2011

<aafaq id=1665> ~ToDo: 1665 How do Tagged IDs work </aafaq> 

This FAQ interface was developed by Jason at Commons.ca

APC: Internet and ICTs for social justice and development APC ActionApps is a free software content management system initiated by the Association for Progressive Communications (APC)
APC - Internet and ICTs for social justice and development