[pmwiki-users] Conditional data
Pico
pmwiki at ben-amotz.com
Wed Apr 5 06:20:30 CDT 2006
Octocias wrote:
> Hi,
>
> I would like to be able to use ONE wiki page to display EITHER a
> summary or the detail.
>
> Like this:
>
> in the wikipage, I want to say:
>
> if ( page name ends with "summary" )
> {
> display this: "blah blah blah"
> }
> else
> {
> display this chunk of content.
> }
>
> The problem is... I will be INCLUDING those wiki pages, so that means
> the file names will be the HOST's file name, not the included filename.
>
> Any suggestions of how I can get around this? Seems it would be cool
> if I could pass a variable to the page.
Take a look at http://pmwiki.org/wiki/Cookbook/ShowHide for an excellent
JavaScript approach provided by Hans.
To see how a non-JavaScript approach might work, and read some
background information, take a look at the concept page at
http://pmwiki.org/wiki/ViewModes/NestedText
Both of these approaches require the user to click on a link to cause
text to be displayed or hidden. If what you want is an approach that
tests for the pagename, without user input, then these are not what you
want. Maybe you can provide some more information about what you are
trying to accomplish: providing for user interactivity or generating
detail and summary page templates that can be deployed with a minimal
amount of extra coding.
Pico
More information about the pmwiki-users
mailing list