Updating themes and exhibit formats for Indexhibit 2
Indexhibit 2 has much greater capabilities over previous versions. For this reason, there will be some work required for this upgrade. In the future, after the upgrade, it will be much easier to update and maintain your website.
Updating Themes
There are a number of changes to the syntax for template variables and plugins. Let's list the changes that need to be made. Variables should be changed from:
<%title%> -> Updating Tempates And Formats
Plugins should be changed from:
<plug:... /> -> <plugin:... />
Indexhibit has a new feature that will queue your CSS and Javascript calls, so you should change to the following lines in the 'head' of your template:
<title><last:ndxz_title /> : Indexhibit Support</title>
<last:page:meta />
<link rel='alternate' type='application/rss+xml' title='RSS' href='https://forum.indexhibit.org/xml/' />
<link rel='stylesheet' href='https://forum.indexhibit.org/ndxzsite/default/reset.css<last:page:version: />' type='text/css' />
<link rel='stylesheet' href='https://forum.indexhibit.org/ndxzsite/default/base.css<last:page:version: />' type='text/css' />
<link rel='stylesheet' href='https://forum.indexhibit.org/ndxzsite/default/style.css<last:page:version />' type='text/css' />
<last:page:css />
<last:page:javascript />
<last:page:onready /><plugin:backgrounder />
Consult the /ndxzsite/default/index.php file to see the full HTML for the base template.
In the template itself you will need to change:
<plug:front_index /> -> <plugin:index:load_index />
<plug:front_exhibit /> -> <plugin:page:exhibit />
At the end of your template, just before the closing 'body' tag, you should add the following too plugins:
<plugin:page:append_page />
<plugin:page:closing />
Note: if you wish to stay with the old 'index' (without all of the new features and should work with your previous #menu customizations) you can use the alternative index plugin:
<plugin:old_index:load />
CSS Changes
The major change with CSS involves the basic structure:
#menu -> #index
#content -> #exhibit
You will need to update these throughout your style.css file and also possibly in exhibit formats.
Finally, check to make sure that any variables you might have in your Pre or Post Nav are using the double curly brackets as well - in the studio Admin section.
Updating Exhibit Formats
Exhibit formats are much more powerful now which will bring alot of really exciting possibilities over time. Updating them is not difficult unless you have made alot of customizations to them. This tutorial will cover the basics but you should consult our forum for more information and help. You can also look at existing formats in /ndxzsite/plugin/ to get an idea of their general structure.
Note: we will be updating the common formats and providing them in our plugins sections - check back soon to see if your format has already been updated.
You need to move your old exhibit formats from /ndxz-studio/site/plugin/ to /ndxzsite/plugin/ and rename them from exhibit.$format.php to format.$format.php. If your file already exists than it has been updated.
Formats need to be identified by the Indexhibit studio - you need to put some header information at the top of the document just after the first line:
/*
Format Name: Grow
Format URI: http://www.indexhibit.org/format/grow/
Description: Default Indexhibit format.
Version: 1.0
Author: Indexhibit
Author URI: http://indexhibit.org/
Params: format
Options Builder: default_settings
Source: exhibit
Operands: none
Objects: exhibits
*/
Near the top of your file you might seem some lines that could look like the following:
// defaults from the general libary - be sure these are installed
$exhibit['dyn_css'] = dynamicCSS();
$exhibit['lib_js'] = array('grow.vaska.js');
$exhibit['exhibit'] = createExhibit();
The first line would be changed, within the "createExhibit" function (below) like:
$OBJ->page->exhibit['dyn_css'][] = $this->dynamicCSS();
The second line would be changed like (note that you need to get the name of the file correct):
$OBJ->page->add_jquery('grow.vaska.js', 26);
And the third line is simply deleted - it's not longer needed.
Turn your functions into a Class by wrapping all of them with:
class Exhibit
{
// all of the existing functions
}
Replace your images query with the following:
// get images
$this->imgs = $OBJ->page->get_imgs();
We are providing the old Grow format (known as Visual Index for Indexhibit 2) in the plugins area for you to see as an example how an exhibit format can be updated.
While this format tries to provide the basic information about updating your exhibit formats it's not unlikely that it might not cover your situation. Feel free to tell us about your situation in our forum.