[pmwiki-users] Random page generator?

Donald Z. Osborn dzosborn at gmail.com
Sun Oct 25 18:26:16 CDT 2015


Thank you. This works great - at least the first time. Adding it to sidebar
(my aim) seems complicated.

As you say it requires reloading the page with the code. I tried right
clicking and opening in new tab, and each time got the same page. What I'm
hoping to do is put the code in the sidebar to permit a user to sample
pages, or at lest not to get the same random page if the click on "Show
random page" twice before they load or reload another page.

I tried it in the sidebar to see, and the command looks perfect in preview,
and fine when saved (remember that in saving the sidebar you see SideBar as
a page as well as in the sidebar itself). Click on it, and it generates a
random page, but then disappears. ... Reload the page (the one just
generated randomly) and the Show random page is still not there ... go to
another page (via wikilink) and still not there (since one hasn't reloaded
the sidebar).

Not criticizing, as the coding is beyond my reach.



On Sun, Oct 25, 2015 at 5:49 PM, StefCT <stefct4 at gmail.com> wrote:

> On 10/25/2015 10:30 PM, StefCT wrote:
>
> >
> > On 10/25/2015 10:14 PM, Donald Z. Osborn wrote:
> >> Greeetings, Is there a way to generate (call up and open) random pages
> in
> >> the same way MediaWiki does?
> >
> > How about
> >
> > (:pagelist group=PmWiki order=random count=1 fmt=#redirectto
> list=normal:)
> >
> > (:if false:)
> > [[#redirectto]]
> > (:redirect {=$FullName}:)
> > [[#redirecttoend]]
> > (:ifend:)
>
>
> Actually, there is a solution maybe even easier than my first
> suggestion... You could also skip the redirect and try:
>
> (:pagelist group=PmWiki order=random count=1 fmt=#randomPage list=normal:)
>
> (:if false:)
> [[#randomPage]]
> [[{=$FullName}|Show random page]]
> [[#randomPageend]]
> (:ifend:)
>
> This markup will display a link "Show random page". This link will lead
> to a different page from the group "PmWiki" each time you reload the
> page containing the link.
>
> Kind regards,
>
> StefCT
>
>
>
>
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20151025/b5ce6c49/attachment.html>


More information about the pmwiki-users mailing list