Page 1 of 1

Re: Changing the <title></title> in event plugin

Posted: Mon Aug 08, 2005 11:47 pm
by garvinhicking
You are right, this is an oddity that could be fixed.

The plugin authors just need to hook into the "genpage" event and modify

Code: Select all

case 'genpage':
    $serendipity['head_subtitle'] => "Staticpage!";
    return true;
So that's not too hard after all. Patches are very welcome, who's volunteering? :-D

Regards,
Garvin

Posted: Tue Aug 09, 2005 8:54 pm
by garvinhicking
Thanks for your staticpage patch! I included this patch in the new upcoming version of the staticpage plugin which also support child pages and settings a staticpage as frontpage of an entry.

Most of the other markup plugins don't contain conditionals on the genpage headers as they usually execute everytime...do you have specific examples?

Regards,
Garvin

Posted: Tue Aug 09, 2005 11:23 pm
by garvinhicking
Actually the contactform stuff in the genpart hook is needed. It rewrites the subpage header, which is the best place to do, and that doesn't need to be done conditional...

Regards,
Garvin

Posted: Thu Aug 11, 2005 12:43 pm
by garvinhicking
This is a bit hard to explain.

The contact form plugin needs to find its permalink pattern. It executes these checks in the genpage hook - several plugins do this checking of permalinks since it was new functionality introduced which was not in the s9y core. Now to stay backward compatible it cannot be put into the core easily.

So actually the code called in the genpage hook MUST be executed everytime because only then can the plugin check if a permalink page was hit that belongs to the plugin.

Setting the pagetitle though needs to be only set if the page is selected of course.

Regards,
Garvin

Posted: Thu Aug 11, 2005 8:53 pm
by garvinhicking
Hm, this is a good question. I do agree that the performance is insignificant, but leaves a lot space for customization for each plugin. If they would use a central "genpage" plugin hook or function for that, the flexibility would maybe be missing.

On the other hand removing overhead is always a good thing. I need to think a bit on this issue when I have more time, and see if we can add a general function which parses this stuff.

For the time being I suggest to duplicate the 3-4 lines of code until a solution is officially agreed. :))

Thanks and Regards,
GArvin