View Full Version : Incorporate dekiscript into custom html areas?
mdn01
05-23-2008, 11:16 PM
Hello all,
Just wondering if it is (or will be) possible to include dekiscript in custom html areas? I'd like to incorporate some info regarding page title (e.g. using {{ page.title }} ). Can't see how to do this easily with an @api call, and couldn't find any related info after a search of forum or wiki content.
Can always hack the templates, of course, but I'm all for portability.
Thanks in advance for any advice/info,
- Marc
We're actually looking at solving this exact problem in a future release. With 8.05, it became possible for the API to update components of the skin that's not in the main contents (the XML returns <body target="{SKINNING_VAR}">) ... the next step would be extending the insert template call to accept a parameter which would target a skinning variable.
SteveB
05-25-2008, 05:07 PM
We added two new parameters to wiki.template in 8.05.1:
wiki.template(name: str, args : any, target: str, confict: str) : xml
The new parameters are 'target' and 'conflict'. Using 'target' you can specify that the template should be loaded into a different target area of the skin (royk will provide more information for how to do that on the skinning side of things). The 'conflict' parameter won't be necessary for most cases. It describes how the engine should handle the case where more than one result has the same 'target' value. 'Conflict' can be set to 'ignore' (default), 'replace', and 'append'.
mdn01
05-26-2008, 02:38 AM
Thanks, Roy and Steve, this new templating capability should be quite useful.
I'm assuming that the 'wiki.template' Dekiscript will still need to be placed in the content area of a page to target other areas of the skin? Also that the default behavior will be to modify only the target area specific to that particular page. If so, will there be any way to provide a more global application of an inserted template, so that individual sub-pages in a hierarchy inherit a template from the parent page? Or capability of a 'master' template to target an area in every page of the wiki?
Thanks for your ongoing assistance,
- Marc
SteveB
05-26-2008, 03:08 AM
Yes, we're working on that as well. We have a couple of ideas on the drawing board, but nothing definitive yet.
jsteeley
06-13-2008, 03:32 PM
I was able to use this to good effect to create a Wiki News topic that only appears in the Custom HTML 3 area when viewing the root page of the Wiki.
First I created a template with this source:
<h1>Template:WikiNews</h1>
<div id="custom3">
<p>Wiki News</p>
<p>{{ wiki.search{query: "path:Wiki_Policies_and_Procedures/WikiNews/*", max: "10", sortBy: "-date"} }}</p>
</div>
I added this to the root page:
{{wiki.template("WikiNews",nil , "customarea3") }}
I added this to the CSS Overrides to make the new content match the Fiesta PRO theme better:
#custom3 ul ,
#custom3 ul ul ul ul,
#custom3 ul ul ul ul ul ul ul
{
list-style-type:disc;
margin-bottom: 0px;
margin-top:0px;
}
#custom3 {
color:#545e65;
font-size:11px;
font-weight:bold;
line-height:15px;
font-size: 8pt;
margin-top:30px;
margin-left:10px;
}
#custom3 ol,
#custom3 ul
{
margin-bottom: 5px;
margin-top:5px;
padding:0px;
padding-left:10px;
margin-left:10px;
list-style-position:outside;
}
I added this to the LocalSettings.php:
$wgTargetSkinVars = array('languages', 'toc', 'customarea1', 'customarea2', 'customarea3', 'customarea4', 'customarea5', 'customarea6');
aurora
06-13-2008, 04:21 PM
The new parameters of "target" and "conflict" have been added to the documentation of "Wiki.Template" at MDC (http://wiki.developer.mindtouch.com/MindTouch_Deki/DekiScript/Reference/Wiki_Functions_and_Variables/Wiki.Template). Please review and make any corrections or clarifications necessary. I created a link to post #6 as an example of these new parameters in use.
lktest
12-13-2008, 12:59 PM
Damien's new drop-down menu (http://wiki.developer.mindtouch.com/User:Howleyda/DekiScript_dropdown_menu) has got me thinking about this issue again.
How awesome would it be to just add that template call in a custom HTML section at the top of your template once, and have it show up across your site?
(I'll leave the conversation about whether a global navigation menu like this is more effective than the fluid navigation menu that's standard now for another time.)
I understand template targeting of custom HTML sections for content that you want to control on a page-by-page basis. Something like this drop-down menu, though, I'd like to include on every page, without making my users remember to add a template call on every page that they add.
Is there any chance that we'll be able to add straight DekiScript into the custom HTML areas in the future?
Guerric
12-15-2008, 06:56 PM
Damien's new drop-down menu (http://wiki.developer.mindtouch.com/User:Howleyda/DekiScript_dropdown_menu) has got me thinking about this issue again.
...
Is there any chance that we'll be able to add straight DekiScript into the custom HTML areas in the future?
I wouldn't hold your breathe for DekiScript within custom html areas however there is the notion of a global template. The global template gets executed on every page view so if you have the navigation injected via the global template then you will have persistent navigation on every page.
http://wiki.developer.mindtouch.com/index.php?title=MindTouch_Deki/FAQ/Visual_Customization/How_do_I...Implement_global_templates%3F
lktest
12-15-2008, 11:02 PM
Wow, I hadn't really understood how useful global templates could be before! I learn something new from you guys every day.
cz6970
07-20-2011, 02:23 PM
Hi to all,
Its really fun working with templates. I wonder if there is a way to pass in parameters to a template directly by typing as URL.
example: ..wiki/Titre_de_la_page_&action=edit&template=../A_template + parameters
thanks
Powered by vBulletin™ Version 4.1.3 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.