Loading...
 

PluginJSFILE

Description/Usage

This plugin provides the ability to use traditional copy-and-paste javascript code snippets in your wiki pages.

This plugin does one thing: it inserts the contents of the javascript into the BODY of a wiki page (inbetween the < BODY > and < /BODY > tags) at the position where the .js file is called. So, this works for javascripts that only need code to be put in the BODY of a web page.

--> For javascripts where code also needs to be inserted into the HEAD (inbetween the < HEAD > and < /HEAD > tags), an update to this plugin is in the works biggrin

Instructions for Use
  1. Copy and paste your code snippet into a new text document, and remove the , and tags.
  2. Save the document with .js at the end in place of .txt (or you can rename it after saving).
  3. Put this new .js file in the root folder of your tiki installation.

Use the following syntax (replacing js-file_name.js with the name of the new .js file) in the wiki page where you want the javascript to run: {JSFILE(file=js-file_name.js)}{JSFILE}

Download

Installation

Version 2 of JSFILE includes a head parameter {JSFILE(head=js-file_name.js,file=js-file_name.js)}{JSFILE} which allows JavaScript to be added into the HEAD section on the WIKI page.
This version requires 1 line of code to be added in your header.tpl:

Find this near the top of your header.tpl, the key is the /title:
{elseif $forum_info.name ne ''} : {$forum_info.name}
{/if}
</title>

{* --- jscalendar block --- *}
{if $feature_jscalendar eq 'y'}
<link rel="StyleSheet" href="lib/jscalendar/calendar-system.css" type="text/css"></link>

and insert the line after the /title:
{if $jshead ne ''}{/if}

Your finished code should look like:
{elseif $thread_info.title ne ''} : {$thread_info.title}
{elseif $forum_info.name ne ''} : {$forum_info.name}
{/if}
</title>

{if $jshead ne ''}{/if}

{* --- jscalendar block --- *}
{if $feature_jscalendar eq 'y'}
<link rel="StyleSheet" href="lib/jscalendar/calendar-system.css" type="text/css"></link>


arrow This plugin is current under development and available from http://mods.tiki.org


Page last modified on Friday 20 September 2019 16:14:06 GMT-0000

Upcoming Events

No records to display

Why Register?

Register at tiki.org and you'll be able to use the account at any *.tiki.org site, thanks to the InterTiki feature. A valid email address is required to receive site notifications and occasional newsletters. You can opt out of these items at any time.