[wp-hackers] Need help with gallery plugin implementation

David Chait davebytes at comcast.net
Tue Feb 27 18:09:34 GMT 2007

In my own work, I opted for the "Make a Page, use a special Page 
Template" approach.

The page then allows the blog owner to define the niceuri for stuff 
(such as /portfolio/ or /photos/) as the page name/slug, but the 
combination of a custom template plus a plugin then takes over the rest 
of the work (rewrites, admin, etc.).  Once the Page is created, the rest 
is all custom plugin admin panels.  At that point, it all becomes seamless.

This also allows for different pages for different hierarchies, or 
further customization of custom page templates by the user via the 
actual Page content (title, content, custom fields, etc.), gives you 
instant password protection (built-in feature of pages), allows for 
comments if you have that snippet in your template (and want it!), etc.

Yes, it would be nice if there were an option to keep such 'placeholder 
pages' from the main page list functions.  That's not a feature I've 
seen yet ('hidden' but published Pages).  OTOH, usually such a thing 
(portfolio, 'shop', 'news', etc. subsections) is desired to be a 'named 
Page' in the page lists, sidebars, etc.

So, not a perfect solution, but really easy, fits into existing 
architecture, certainly compatible throughout most of wp2 releases.


Pierre-Luc Auclair wrote:
> Hi,
> I'm writing a gallery plugin that's seamlessly integrated to WP. So far I have 
> a lot of the admin panels done as a menu of their own. This all works okay 
> and I have no problem with this.
> Now I'm having a bit of difficulty implementing it how I intended to. Here's a 
> small image to give you an idea:
> http://www.heliosmulti.com/wp-portfolio.png
> The way to access its main page (categories or projects overview, depending 
> how the template is done) should be blogroot/portfolio.php 
> Categories available from /portfolio.php?cat=id
> Projects available from /porftolio.php?project=id
> Images available from /portfolio.php?img=id
> All will be mod_rewrite redirected for convenience.
> I don't want the gallery plugin to be available as a page (from the pages 
> list), nor setup as templates. Its pages won't appear under the Manage Pages 
> admin panel since the plugin has an administration of its own.
> Calling the gallery page should be calling the proper page template from the 
> themes directory.
> Such a theme would look like a normal page, except that all the functions in 
> them apart from the normal get_header and stuff will be getting the plugin's 
> data.
> How can I achieve that?
> Thanks,
> Pierre-Luc

More information about the wp-hackers mailing list