Latest Register Log In

+ Advanced Search


Show Custom Template Anywhere
Oct 31, 2004 (Edited Mar 11, 2014)

The code:
/* Supply the path to WSN and the name of your template on the lines as requested */
$pathtowsn = '/full/file/path/'; // same as the uploadpath value in your wsn config.php file but without the 'attachments/' part
$yourtemplatename = 'mytemplate.tpl'; // the template, located in the 'custom' subdirectory of your templates directory, that you want to display
$usewrapper = 'yes'; // set to 'no' if you don't want to show the WSN wrapper

$curr_path = getcwd();
require 'start.php';
if (!$template) $template = new template('custom/'. $yourtemplatename);
require 'end.php';

Fill in the $pathtowsn and $yourtemplatename values there and save it as yournamehere.php in whatever directory you have in mind.

Want it to apply over a particular page? Replace
require 'start.php';
if (!$template) $template = new template('custom/'. $yourtemplatename);
require 'end.php';
$_GET['custom'] = 'yes';
$_GET['TID'] = 'yourtemplatename';
$_REQUEST['TID'] = $_GET['TID']; $_REQUEST['custom'] = $_GET['custom'];
require 'index.php';

Change index.php to the php file you want, and set the appropriate GET parameters you want to pass besides custom and TID. For example, to overlay on a particular category display page, get both REQUEST and GET for action to equal 'displaycat' and then set catid to equal the desired category number.

Did this article fail to fully answer your questions? If so, please ask for clarification.

Your E-mail:
(needed so that you can get your answer!)
Confirm E-mail:
(same as above to prevent typos)

Description Showing your content outside of the WSN directory.
Views 2,178 views. Averaging 0 views per day.

Previous Article | Next Article