[pmwiki-devel] Cluster & skin integration

Hans design5 at softflow.co.uk
Sun Mar 18 05:21:19 CDT 2007


Sunday, March 18, 2007, 9:57:49 AM, Kathryn wrote:

>>    If yes a skin could provide an array of subpage variables, and
>>    Cluster can process these. Then Cluster does not need to keep a
>>    perhaps growing list of subpage PV functions.

> I'm not sure how, I'd have to look at the code.
> It might be possible to generalize the function so you passed
> in the name of the page you were looking for.

> If that was possible, then the Triad skin could set whatever page
> variables it wanted, something like this:

> if (function_exists('ClusterPageName') {

>         $FmtPV['$ClusterSomePage'] = 'ClusterPageName($pn, "SomePage")';
> ....

> } else {
>         $FmtPV['$ClusterSomePage'] = '';
> }

> Then in your template you could have

> <!--wiki:{$ClusterSomePage} {$Group}.SomePage {$SiteGroup}.SomePage-->

> That would work whether Cluster was being used or not, since if Cluster
> is not being used, then {$ClusterSomePage} would be empty, and the skin
> would fall back to {$Group}.SomePage as per usual.

I think it should be possible. If you need help with it I may put some
work into it. The code suggestion for the skin looks good. But I won't
need

else {
         $FmtPV['$ClusterSomePage'] = '';
  }

If a PV  is not defined then {$NotDefined} is empty and will do no
harm in the skin template.


>> And I like to extend this to all subpages called, so I need
>> {$ClusterTitleBar}, {$ClusterPageHeader}, {$ClusterPageTopMenu},
>> etc. (there are more!).

> Oh my!

:-) well why not, it just extends flexibility already there:
You can already load group specific headers and action menus etc in
Triad. You can even have page specific RightBar pages, and page
specific TitleBar pages (useful if you like to create the odd page
title as an image, i.e. perhaps some fancy font).


>> if ($EnableBreadCrumbPageName==1 && $name != $DefaultName && $name != $group)
>>   {
>>     $out .= " $ClusterBreadCrumbSeparator ";
>>     $out .= "'''" . '[[{*$Namespaced}]]' . "'''";
>>   }
>>   return $out;

> Ah.

??? 8-)

>> But I would like to use more descriptive PV names for the Cluster PVs
>> inside the skin template. So instead of {$SideBar} etc I like to use
>> {$ClusterSideBar} and {$ClusterRightBar}.

> I thought that $SideBar and $RightBar were simpler, but I could
> certainly change them to $ClusterSideBar and $ClusterRightBar.

Using $ClusterPageName is making the skin code easier to understand,
someone will know that it refers to the Cluster script.
But if we get the general ClusterPageName function then it does not
really matter, as the skin author can choose whatever names, not
relying on you to put them in the Cluster script.

Thanks for considering all this!

Cheers,
Hans




More information about the pmwiki-devel mailing list