[pmwiki-users] Random page generator?
StefCT
stefct4 at gmail.com
Sun Oct 25 19:16:57 CDT 2015
Hi Don,
On 10/26/2015 12:26 AM, Donald Z. Osborn wrote:
> Thank you. This works great - at least the first time. Adding it to sidebar
> (my aim) seems complicated.
>
> 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).
If you are using the code in the SideBar, you probably need to change
the first line to:
(:pagelist group=PmWiki order=random count=1 fmt=Site.SideBar#randomPage
list=normal:)
Otherwise PmWiki will be unable to find the page list template named
"randomPage".
Does this solution work? In my wiki, it works fine.
Stef
>
> 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
>>
>
More information about the pmwiki-users
mailing list