[pmwiki-users] A couple of newbie questions

Chris Cox ccox at airmail.net
Thu Oct 6 11:12:49 CDT 2005


Jonathan Scott Duff wrote:
> On Thu, Oct 06, 2005 at 08:02:11AM -0500, Tegan Dowling wrote:
>>Hi, Charles,
>>
>>Regarding the "Edit SideBar" link question: On your Site/SideBar, you have
>>
>>* [[SideBar?action=edit | Edit SideBar]]
>>
>>Could you not replace that with
>>
>>* [[Site/SideBar?action=edit | Edit SideBar]]?
> 
> He could but then the edit link would *always* edit Site/SideBar
> rather than the SideBar of the current group.  What's needed is a way
> to conditionally change that link:
> 
> (:if group Main:)
> * [[Site/SideBar?action=edit | Edit SideBar]]
> (:if !group Main:)
> * [[SideBar?action=edit | Edit SideBar]]
> (:ifend:)
> 
> The above is untested and purely from my memory, so caveat lector!

In our skin tmpl file we use...
<!--wiki:$Group.SideBar Main.SideBar-->

(I'd use Site.SideBar now... ours dates back to the early v2 betas)

The Main.SideBar (would probably be Site.SideBar now) says:

* [[Main/HomePage | Home ]]
* [[Main/LabsBB|Bulletin Board]]
* [[Main/ShipRequest|Ship Request]]
* [[Main/Backups | Backups]]
* [[Main/NetworkMonitor | Monitoring]]
* [[Calendar/Calendar | Calendar]]
* [[Main/AllRecentChanges | Recent Changes]]
* [[LABSSupport/LABSSupport | LABS Support]]
* [[Main/Management]]
----
* [[Main/LoginPage | Login]]
* [[Profiles/Profiles | Users]]
----
* [[PmWiki/PmWiki | Wiki Help]]
(:if loggedin true:)
----
'-''[[{$Group}/SideBar?action=edit|Edit {$Group}\\
SideBar]]''-'
(:if:)

Then for a particular Group... let's say the Unix
Group, we could override (augment) the SideBar with
Unix/SideBar:

*[[Unix/SIT|Inventory]]
*[[Unix/AIX]]
*[[Unix/HPUX]]
*[[Unix/Linux]]
*[[Unix/Solaris]]
*[[Unix/Tru64]]
*[[Unix/Maintenance]]
*[[Unix/Server Info]]
*[[UnixCalendar/UnixCalendar|Unix Calendar]]
----
(:include Main/SideBar:)

Again, I'd use Site/SideBar now.. but for us Main/SideBar
was the rule of the day.

As you can see, we tend to fully qualify our links
with the Group... this is because you don't know where
you might (:include:) a page.

Just our convention.




More information about the pmwiki-users mailing list