Markup and Aliases

From ARK
Jump to: navigation, search

Labels and marked up text is handled in a language independant and code independant way. Text should be stored ready marked up. The use of wiki style formatting should be restricted tot he markup editor pages which are not yet written. This would allow wiki styling to be used by the user, but storing the records marked up.

Bear in mind that a lot of chunks of text already exist in the form of column or table aliases. Try to make use of the standard aliasing methods before creating custom labels.

All markup is stored in a modular style. Some elements will be most appropriate in the core module and others at the module level. The table containing the markup is supplied to the retrieval function (example bellow).


Get aliases for fields, columns, tables and anything aliased using the getAlias function.


//get the label for the field
$alias = getAlias($db, 'cxt_lut_txttype', $lang, 'id', $field);


Get labels which are not alias back from the markup table using the getMarkup function.

As a rule set a string to hold the markup which consists of the prefix $mk_ followed by the nickname of the markup as held in the markup table.

Then when you output the text, you may refer to it as $mk_nickname.


$mk_no_interp = getMarkup($db, 'cor_tbl_markup', $lang, 'no_interp');
printf ("<li>$mk_no_interp</li>");

Extended Markup