MindTouch Developer Center > MindTouch Deki > FAQ > Visual Customization > How do I...Target skinning variables from the content?

How do I...Target skinning variables from the content?

Table of contents
No headers

Starting with Deki Wiki 8.05.1, it is possible to insert the outputs of a template as a skinning variable into your template (template targeting). This lets you take full advantage of the DekiScript engine for all parts of your skin, not just the main content!

To achieve this effect, you'll first need to create a template. I've created a very basic template which will just output the date:

template-target-1.gif

Secondly, I've updated the skin I'm using (Ace) with a new skinning variable:

template-target-3.gif

In this example, I've named the skinning variable "currentdate," but you can name it whatever you'd like. If you want to copy it into your own skin, I've written out the HTML below:

<div class="b-body" style="font-size: 11px; font-weight: bold;">
    <?php $this->html('currentdate');?>
</div>

Now that you know which skinning variables you want to target, you'll need to update LocalSettings.php so that a skinning variable can be overwritten (this is for security reasons - otherwise anybody could overwrite any skinning variable!).

$wgTargetSkinVars = array('languages', 'toc', 'currentdate'); // languages and toc are used by Deki Wiki internally

Finally, you should edit a page content and tell Deki Wiki to add something to the "currentdate" location:

template-target-2.gif

In this screenshot (which I've saved and re-opened in the editor), you can see the skinning variable displaying the current datetime above the editor, right where we placed it in the skin. The opened editor shows the wiki.template call to execute this behavior; the third parameter of wiki.template tells which skinning variable to target. See the documentation for wiki.template for more info.

Tag page
You must login to post a comment.
Powered by MindTouch Deki v.8.08