[pmwiki-users] First steps in cookbookland

Marc Cooper gmane at auxbuss.com
Tue Jun 27 05:26:41 CDT 2006


Patrick R. Michaud said...
> On Tue, Jun 27, 2006 at 07:29:53AM +0100, Marc Cooper wrote:
> > Marc Cooper said...
> > > Now, of course, I need to link to PmWiki pages. Since I am generating 
> > > HTML from my script, I'm not clear how I should do this.
> > > 
> > > Basically I want to do this:
> > > 
> > >     $out .= '<li><a href="a Group/Page from PmWiki></a>';
> > > 
> > > I've tried all sorts of permutations of 
> > > 
> > >     $out .= '<li><a href="$something/Group/Page" >Label</a>';
> > > 
> > > but I can't see the wood for the trees :-o
> > > 
> > > Any help would be appreciated. Thanks.
> > 
> > Can anyone help, please?
> > 
> > Is the only way to do this to hard-code the URLs?
> 
> I think we'd need a little bit more information about your
> configuration.  In particular, when the script runs does it
> have access to the PmWiki functions, or is it run external to
> pmwiki.php?

Sorry. I'm running the script as a recipe. So, in the Sidebar I have - 
amongst other things -

(:if authid:)
(:CustMenu {$AuthId}:)
(:ifend:)

This markup returns a list of URLS unique for that customer/user. Hence, 
the above.

> As a possible answer to your question, note that in
> 
>      $out .= '<li><a href="$something/Group/Page" >Label</a>';
> 
> the substitution will never take place because the string is
> in single quotes instead of double.  You might want instead
> 
>      $out .= "<li><a href='$something/Group/Page' >Label</a>";
> 
> so that $something is properly substituted.

Sorry again, I didn't mean those examples to be literal, they were just 
indications of what I'm trying to achieve - kinda pseudo code, if you 
will.

After further experimentation this morning, I've found that the 
following work:

    $out .= '<li>[[http://www.example.com/somewhere | Nowhere]]';
and
    $out .= "<li>[[Profiles/AccountAdmin | Account admin]]";

This comes as a bit of a surprise. Is there a doc somewhere that 
describes the parsing order and effects?

Apologies for the naive questions, but there's no O'Reilly cookbook yet 
;-) and I'm at that part of the exponential learning curve that's rather 
slippery.

-- 
Best,
Marc





More information about the pmwiki-users mailing list