 |
Forums |
Admin Start New Thread
By: Thomas Leitner
RE: single source file, multiple output files [ reply ] 2008-03-21 16:04
|
Hi,
this is possible since each file in the source directory can be processed by an arbitrary number of file handlers.
It seems that you want a special File/GalleryHandler. Best start would be to copy the source file for the gallery handler, change the class and plugin name and see how it does its work.
Basically, the File/GalleryHandler does the following:
* get an array of all images that should be used in the gallery
* create gallery pages with a certain number of images on them (#create_gallery_pages)
* create an image page for each image (#create_image_pages)
* eventually create thumbnails (#thumbnail_for)
* eventually create a main page if more than one gallery page has been created (#create_gallery)
All the gallery/image/main pages are basically empty page files containing a special object (class GalleryInfo) which is used in the various template files to create the actual HTML file.
So the best way to tackle the problem is, I think, to adjust the #create_image_pages method to create the two needed pages and then adjust the rest as needed.
That's for the gallery handler. Now to the menu generator. The menu generator is access via the menu tag in which you can specify what you wanna display in your menu. If you only want to display all gallery files, it would be easiest to put them in a separate directory and tell the menu tag to just display contents under this directory.
For example, if you have your gallery files under /galleries/new_zealand you can add the following menu tag to your gallery templates:
{menu: {menuStyle: vertical, options: {startLevel: 3, maxLevels: 5, showCurrentSubtreeOnly: true}}}
hth!
-- Thomas
|
By: John Allsup
single source file, multiple output files [ reply ] 2008-03-19 17:36
|
Is it possible, for example, to have a source file and have it generate two separate html files by running the same content through two or more templates? This would be useful since with a gallery, for example, one could create a basic picture+info page and a zoomed-in picture page from the same source file.
Also, how hard-wired is the menu generator, since it would be useful to be able to create multiple menus. With the gallery example suggested above, collecting all gallery files together into a menu that could be included only on gallery pages would be useful.
|
|
 |