[pmwiki-users] Variable question

David Spitzley dspitzle at wash.k12.mi.us
Wed Apr 6 09:48:55 CDT 2005


>>> "Patrick R. Michaud" <pmichaud at pobox.com> 04/05/05 5:24 PM >>>
On Tue, Apr 05, 2005 at 04:54:50PM -0400, David Spitzley wrote:
> I want to set up a small snippet of code which will set the
EditTemplate
> to "Content.CountyTemplate" if the user makes an edit request from
> "Content.MichiganCounties", but I don't know how to check the origin
> page.  Is there a variable which contains the page name and/or group
of
> the >referring< page?

Try this:  In local/Content.MichiganCounties.php, place the line 
(apologies in advance for it's length -- such is HTML):

$LinkPageCreateFmt = "<a class='createlinktext'
href='\$PageUrl?action=edit&amp;template=Content.CountyTemplate'>\$LinkText</a><a
class='createlink'
href='\$PageUrl?action=edit&amp;template=Content.CountyTemplate'>?</a>";

This changes the "edit new page" link for Content.MichiganCounties to
automatically include the template= parameter.
-------------------------------------------------

Ok, having just tested it, that works just >peachy<!  I will add some
Cookbook material on the subject as soon as the website is accessible
again.


David



More information about the pmwiki-users mailing list