[pmwiki-devel] Cluster & skin integration

Kathryn Andersen kat_lists at katspace.homelinux.org
Sun Mar 18 04:57:49 CDT 2007


On Sun, Mar 18, 2007 at 09:09:53AM +0000, Hans wrote:
> And for changing the titlebar section I am adding a Site.TitleBar page,
> acting as a subpage.
> 
> 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.

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

Oh my!
 
> My questions are:
> 1. Could you support such naming scheme in Cluster?
Possibly.
 
> 2. Would it be possible to change the function code in Cluster so you
>    got just one function processing an array of names, instead of a
>    series of unctions, each called by a Cluster subpage PV?
> 
>    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.
 
> 3. From having played with Cluster I would like a
>    $EnableBreadCrumbPageName var in Cluster by which I can optionally
>    disable the addition of the page name to the breadcrumb trail,
>    i.e. change the last part of the code perhaps to
> 
> if ($EnableBreadCrumbPageName==1 && $name != $DefaultName && $name != $group)
>   {
>     $out .= " $ClusterBreadCrumbSeparator ";
>     $out .= "'''" . '[[{*$Namespaced}]]' . "'''";
>   }
>   return $out;

Ah.

> 4. I find {$BreadCrumb} a strange choice. {$ClusterGroups) or
>    {$ClusterGroupLinks} would say a lot more to me and make the
>    association with the recipe very clear. Even {$Cluster} on its own.

I called it $BreadCrumb because I was using it for the breadcrumb trail
in my own Bonny skin.
 
> 5. I wonder if I should put into the new Site.TitleBar page for Triad
>    as default a switch to load the Cluster group links - Bread crumbs:
> 
>    >>pagegroup<<
>    (:if enabled {$BreadCrumb}:){*$BreadCrumb}(:else:)[[{*$Group}/]]
>    >>pagetitle center<<
>    ![[{*$FullName}?action=browse|{*$Titlespaced}]]
>    >><<

What I use for Bonny is
(:if !equal "{*$BreadCrumb}" "":){*$BreadCrumb}(:else:) .... 

Because if the variable is empty, Cluster isn't being used, and one
should fall back to whatever one was using before.  No need to test for
any other variables being enabled.
 
> Another thought when playing with cluster was that it would be nice to
> switch off the ? and dots.... under group links to non existent group
> homepages. But I see this  as a skin modification, and will add this
> to Triad, so that group links in the titlebar have ? and ... removed
> and look decent.

Yeah, I think that's a skin-related thing.

Kathryn Andersen
-- 
 _--_|\     | Kathryn Andersen	<http://www.katspace.com>
/      \    | 
\_.--.*/    | GenFicCrit mailing list <http://www.katspace.com/gen_fic_crit/>
      v     | 
------------| Melbourne -> Victoria -> Australia -> Southern Hemisphere
Maranatha!  |	-> Earth -> Sol -> Milky Way Galaxy -> Universe



More information about the pmwiki-devel mailing list