devel at portalparts.com
Fri Jan 4 00:43:10 EST 2008
I may not have properly explained what I had in mind but yes, I have
spent time with Chameleon and do understand what and how it's working.
It's because of that for which I was suggesting the change. I don't
think it's a good long term strategy to copy the complete COM_siteHeader
and COM_siteFooter functions into the themes. There are already a number
of changes in CVS and with each release. Sites have to merge manually
the changes into their themes and I suspect most site admin's won't know
where to start and will have to wait for the theme owner to release an
As you noted 99% of the code was copied to functions.php and then for
chameleon, you moved sections of code from COM_siteHeader to
COM_siteFooter. What I was suggesting is there are sections of related
code blocks that can be broken out into smaller functions and then
called as needed from either header/footer passing in the target
template. This way the core code can be maintain outside the templates
but still be modular enough so that theme designers can pick and choose
and extend as required.
Certainly was not suggesting we remove the over-ride functionality to
use theme specific functions.
Mark R. Evans wrote:
> If you look at what Chameleon does, it actually duplicates 99% of the
> code in COM_siteHeader() and COM_siteFooter(). The 1% I left out was
> the logic on whether the left / right blocks are built in the header /
> footer. We had to add a lot of code to do things the new CSS based
> way as well. Chameleon renders the full page in COM_siteFooter()
> which is very different from how the stock functions work.
> Originally, all I had COM_siteHeader() do was set the global variables
> for the parameters passed. It wasn't until I realized that some
> plugins don't buffer the COM_siteHeader() call or their output that I
> created a new template, htmlheader.thtml and now send the HTML headers
> in COM_siteHeader(). The rest of the heavy lifting is all done in
> COM_siteFooter(). The #1 goal of this approach is to render the
> content first, then the left / right if enabled. Unless I'm missing
> something, the only way to do it as Geeklog is currently designed is
> to do it in the COM_siteFooter() call, along with a little PHP magic
> to force the buffering of plugins / Geeklog's content.
> From the perspective of the Chameleon approach, adding a set of
> functions with the template handle as a parameter won't give me the
> control I need to accomplish what we're doing. I can certainly see
> some value for themes that continue to use the table based structure.
> It would add the ability to easily add or modify certain aspects of
> the templates.
> Personally, I would just remove COM_siteHeader() / COM_siteFooter()
> completely from lib-common.php and put it in the themes
> functions.php. Generally the first step in creating a new Geeklog
> theme is to copy Professional over and start hacking. I don't see the
> functions.php as any different than a specific template file. This
> would give each theme full control over the functions without having
> any duplicate or unnecessary code sitting around.
> Obviously this would have to be a staged approach. Maybe in v1.5 you
> have if (!function_exists('COM_siteHeader')) ... so it is duplicated
> in both places (lib-common and function.php), but it gives a safety
> net for folks with custom themes to just make the necessary template
> changes after upgrading. Then in 1.5.1 or 1.6 or whatever is the next
> major release, they come out of lib-common.php completely.
> If they stay in lib-common and are enhanced by new functions in
> lib-layout.php, I would ask that the ability to override by the theme
> not be removed.
> Blaine Lang wrote:
>> I was looking at how we could make it easier to create theme specific
>> siteHeader and siteFooter functions - specifically with Chameleon but
>> I've also had to create theme specific functions in the past. It's
>> not hard - copy/paste and modify but 90% of the code or more is the
>> same as in the lib-common functions and these functions evolve every
>> release. Chameleon has moved some of the code from COM_siteHeader
>> into COM_siteFooter (theme versions) but still it's mostly
>> restructuring of code chunks.
>> I was thinking that it may be a good idea to create a set of
>> functions which take the &$template variable which would be called by
>> the header and footer related functions. This way the code to set the
>> siteheader menu could be called in the header or footer function,
>> same for the code to generate the left or right blocks etc.
>> Reason to consider this now is for easier ongoing support of custom
>> Is this a new feature or a change (not sure)
>> Is it worth doing as part of 1.5 - thats the ?
>> geeklog-devel mailing list
>> geeklog-devel at lists.geeklog.net
> geeklog-devel mailing list
> geeklog-devel at lists.geeklog.net
More information about the geeklog-devel