Quantcast
Channel: Wolf CMS Forum - Plugin Views and page-parts
Viewing all articles
Browse latest Browse all 5

Re: Plugin Views and page-parts

0
0
[code] Untitled Document content('plugin_header');//plugin generated ?> includeSnippet('header'); ?> content('plugin_sidebar');//plugin generated ?> includeSnippet('othersidebarcontent'); ?> content('body'); //normal page part edited by user ?> content('plugin_content'); //plugin generated ?> includeSnippet('footer'); ?> [/code] That's what I'm trying to do, although that's obviously a very simplified layout. It includes user-generated areas and a couple of plugin-generated parts which ANY plugin can then use to inject it's content into. So if you have 10 plugins that all basically use the same layout, you tell them all to use a single page from the frontend and they generate their own header content and page content. I've always liked the forum plugin that's available on this site. It's entirely self contained. You drop it in, tell it which page to use and forget about everything else. No need to know what files it uses, no need to worry about anything, just plug and play. The above is just an attempt at replicating that kind of experience. Install a plugin, drop in a pre-defined piece of code and forget about the rest. It's a bit like OOP. All your public functions are essentially gateways into a more complex class. Your end user calls myFunction() and never has to care that you're doing 17 pages worth of number crunching. They also never have to change their code if you update your class. I just like the idea of plugins working that way. It's not the best solution, I'd assume creating views and parts on the fly is causing a hit on the database, but it's a start I guess :)

Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles





Latest Images