June 1, 2007

the setting I forgot about

Filed under: ZenMagick — DerManoMann @ 1:35 am

This is another episode about random ZenMagick facts.

Todays’s topic is the magic setting metaTitlePrefix, which has a default value of title_. I had all but forgotten about this setting until this week I did some changes to ZMMetaTags.

The relevant code where it is used looks like this:


$pageTitleKey = zm_setting('metaTitlePrefix').$page;
if (null != _zm_l10n_lookup($pageTitleKey, null)) {
$title = zm_l10n_get($pageTitleKey);
}

So, what it does is looking for an l10n mapping with a key of ‘title_’.$page, for example, for the homepage this would evaluate to title_index. If the language map contains that key, the value would be used as title.

In more general terms this means that the keys in the language map do not need to be proper text, but can be any string you like. The advantage of using text, as done in ZenMagick, is that mappings are only needed if multiple languages need to be supported (or English is not your language).

Other situations where using a prefix might be useful could include things like custom meta tags keywords or other page specific data.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

You must be logged in to post a comment.