Actually I gave up on the idea as it was too much work and I had little time. But it can be done. This is how to do it,
The following is code of a sample custom page, which has the VB header, navbar and footer and CMS Widgets as it's main content. The page is far from finished, like I said I abondoned the idea of implementing this. I am sharing the code so that if someone else wants to do this he has a starting point.
PHP Code:
<?
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'test');
define('CSRF_PROTECTION', true);
// change this depending on your filename
// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();
// get special data templates from the datastore
$specialtemplates = array();
// pre-cache templates used by all actions
$globaltemplates = array('TEST',
);
// pre-cache templates used by specific actions
$actiontemplates = array();
// ######################### REQUIRE BACK-END ############################
// if your page is outside of your normal vb forums directory, you should change directories by uncommenting the next line
// chdir ('/path/to/your/forums');
require_once('./global.php');
// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
$navbits = construct_navbits(array('' => 'Test Page'));
$navbar = render_navbar_template($navbits);
// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'My Page Title';
// ##### INCLUDE WIDGETS #####
require_once('./includes/class_bootstrap_framework.php');
vB_Bootstrap_Framework::init();
vBCms_View_Widget::registerTemplater(vB_View::OT_XHTML, new vB_Templater_vB());
$widgetID = 27; // the id of the widget, this you can get from the CMS_WIDGET table
$widgettype = 'RecentArticle'; // type of the widget you want to output, this is the Class Name, you can get this from packages/vbcms/widget folder. The file names are usually the same as classnames
$widget = vBCms_Widget::create('vBCms', $widgettype, $widgetID);
$output = $widget->getPageView()->render();
// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######
$templater = vB_Template::create('TEST');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('pagetitle', $pagetitle);
$templater->register('widget', $output);
print_output($templater->render());
?>
You will obviously run into styling issues as your widget css would not be available for the custom page, but i didn't spend time on that.
--------------- Added [DATE]1290712997[/DATE] at [TIME]1290712997[/TIME] ---------------
Quote:
Originally Posted by El Intocable
I will follow up on this, I will love to do the same but Im bad with variables. Im trying to archive a page like this one here http://www.minatica.be/content/
but I have no clue where to start from. I seen many sites getting this done but unfortunately for me is not the case.
|
That's RS_Jelle's site. He's a very talented coder (Downloads II)...