Daniel | 7 Feb 17:21
Picon
Picon
Favicon
Gravatar

Previous Page

Hello,
I want to put something in my page like

"You are coming from {$PrevPage}"
(Where $PrevPage is the previous page)

so I put in config.php

$pagename = ResolvePageName($pagename);
if ($pagename != $prevpage) {
  $prevpage          = ResolvePageName($prevpage);
  $FmtPV['PrevPage'] = PageVar($prevpage, '$FullName');
  $prevpage          = $pagename;
}

(inspired by a recent post on this list)

But it doesn't work. Probably because I do not fully understand the
working of these functions -I cannot find any documentation.
Can someone help me here?

TIA, Daniel K
Petko Yotov | 7 Feb 09:35
Picon

Re: Pagelist or Page Variable fail? bug or feature?

On Tuesday 07 February 2012 01:44:39, Crisses wrote :
> the template is defined at Site/LocalTemplates, not on the GroupHeader
> page.

Oh sorry. Earlier you wrote that :

> >>> Then I put a template into GroupHeader, so it would be displayed on
> >>> every page

so  I assumed you put the template in the GroupHeader and not in 
Site.LocalTemplates. 

By "template" I also assumed you ment "pagelist template", the snippet which 
is repeated for every page in the pagelist.

If your template [[#person]]...[[#personend]] is in GroupHeader, you need to 
use fmt=GroupHeader#person. If it is in Site.LocalTemplates, you should be 
able to use fmt=#person unless the browsed page contains a [[#person]] anchor 
-- in that case, use fmt=Site.LocalTemplates#person.

The fmt=#title should also work with the #title snippet from 
Site.LocalTemlates or from Site.PageListTemplates unless your browsed page 
contains an anchor [[#title]].

And no, $SearchPatterns doesn't restrict the source pages for template 
snippets.

I enabled your $SearchPatterns setting for the group you created:
  http://www.pmwiki.org/wiki/XESTest

(Continue reading)

Picon

PmWiki as page clipping service

I have the desire to use PmWiki as a page clipping service (a la
evernote and others). I have been working on the addlink recipe to
make it more usable, but there are some features I'd like to add.

Instead of catching all the clips into a single page, I'd like to put
each clip into a new wiki page. I'd like to include things like links
and images from the clipped selection in the new wiki page (which
would involve sending the source of the selection rather than the just
the text, and then converting the HTML to PmWiki markup).

Ideally, I would like to be able to be able to create a wiki page for
a clipped web page in *any* group, using the group's (or site's) new
page template as a starting point for adding the clipped page. Or,
alternatively, have a ClippedPageTemplate available to use as a
starting point. (For reference, in my addlink recipe, I have a
configuration variable that the admin can set in local/config.php to
determine how the clipped data is added to the link catching page.)

The main issue for me, though, is authorization. I keep my wiki locked
down from guest authoring to avoid spam, having just the link catching
page world-writeable. In the scheme I propose, the group (or in the
alternative above, the full wiki) for catching clipped pages would
need to be world writeable, and I want to avoid this if possible. How
can I force the user to authorize, and maintain the information coming
from the clipping bookmarklet?
Crisses | 6 Feb 17:12
Favicon
Gravatar

Pagelist or Page Variable fail? bug or feature?

Hi,

Got a potential bug? 

I had set:
$SearchPatterns['default'][] = '!\\.Group(Header|Footer)$!';

Because I didn't want GroupHeader or GroupFooters displayed in search results.

Then I put a template into GroupHeader, so it would be displayed on every page.  Normal text and PTVs work fine in the GroupHeader, but this failed:
(:pagelist name={*$FullName} fmt=#person:)

To be sure, I also attempted the stock pagelist template:
(:pagelist name={*$FullName} fmt=#title:)

Both died silently.

However this worked:
(:pagelist name=Group/SpecificPage fmt=#person:)

Disabling the $SearchPattern fixes this behavior.

I wouldn't think the $SearchPattern restriction would prevent this GroupHeader pagelist template from being pulled into the top of a viewed (non-GroupHeader) page.  Shouldn't {*$FullName} be evaluated before the block on a pagelist/search result of "Group.GroupHeader"?  

I can understand why the template wouldn't show up ON the GroupHeader page (that doesn't bother me).  But when I view Group/SpecificPage it should show the data in the pagelist template I've defined in GroupHeader.

Thanks! :)

Crisses


_______________________________________________
pmwiki-users mailing list
pmwiki-users <at> pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-users
Jan Erik Moström | 6 Feb 15:57
Picon
Gravatar

Session conflicts - how to handle this

Hi all,

I've got a question for how to handle a session info conflict. I use
PmWiki for courses I teach, I usually just put up a quick
wiki-installation and author my course pages. These pages are run with
the web server as the owner of the session.

On the same server I also have my private wiki which is run as me as
the owner of the session.

The problem is that if I log in to a course site, do some editing and
then go my own site I get a session  error:

Warning: session_write_close() [function.session-write-close]:
open(/var/tmp//sess_527c5ae290cedf702739519de9cb5bdc, O_RDWR) failed:
Permission denied (13) in /XXXXXXXXXX/pw/pmwiki.php on line 2045

How do I handle this situation?
Andrzej Tokarski | 6 Feb 12:36
Picon
Favicon
Gravatar

Enabling search only for logged in

Hi,

How can I create page with something like

if (admin_logged_in)
  (:searchbox label=$[Go] value=$[Search] focus=on:)

and in config.php:

if (!admin_logged_in)
  if ($action == 'search') $action = 'browse';
?

Regards,
A
Martin Kerz | 4 Feb 15:42
Gravatar

Re: Link to last visited page

Thanks, Peter,

I agree, the first option looks ugly. Alas, your second option seems too complicated for my limited php
skills, although I perhaps will have to end up trying it if my following idea doesn't work.

My reasoning is the following:

With pmwiki we have a perfect document based database using PTVs. So using FoxForms we could set a PTV
containing the previous page name in a dedicated page. This way I could even use conditionals to prevent
the setting of PTVs on e.g. dialogs (which basically are nothing more but wiki pages). Access would be more
than easy using standard PTV markup.

I'll let you know if that works. If not … :-/

Thanks again!

Martin

Am 04.02.2012 um 15:16 schrieb Peter Bowers:

> On Sat, Feb 4, 2012 at 10:06 AM, Martin Kerz <mkerz <at> me.com> wrote:
>> can I somehow get the $FullName of the last visited page before the current one?
>> 
>> I would love to have something like {<$FullName} in wikitrails. Has anyone ever done this? It would be
necessary for a cancel button in a jquerymobile cancel dialog.
> 
> Here's one possibility -- maybe a bit ugly because it's visible to
> users who look in the address, but at least it may be a start...
> 
> You could change the link format so that every link would always
> append a ?prevpage=Mygroup.Mypage and then you would have access using
> the appropriate $_GET['prevpage'].
> 
> I don't remember exactly how I accomplished changing the link format
> (and I don't know whether it's the best way) but when I was doing my
> PageHist recipe I changed all links so that they maintained a
> ?asof=<date> from page to page.  You can see how I did it by checking
> out pagehist.php at http://www.pmwiki.org/wiki/Cookbook/PageHist.
> 
> Another option would be to simply set a value in $_SESSION each time
> you load a page (you'll have to figure out where that can be done in
> config.php in terms of when sessions are initialized - seems like I
> had some trouble finding that point during some previous work but I've
> forgotten the details).  You could keep a whole list of history (last
> n pages) if you wanted to...  This has the benefit of not being
> visible to the user.
> 
> HTH or at least gives some ideas that may get you started...
> 
> -Peter
Peter Bowers | 4 Feb 15:17
Picon
Favicon

Re: Link to last visited page

On Sat, Feb 4, 2012 at 10:06 AM, Martin Kerz <mkerz <at> me.com> wrote:
> can I somehow get the $FullName of the last visited page before the current one?
>
> I would love to have something like {<$FullName} in wikitrails. Has anyone ever done this? It would be
necessary for a cancel button in a jquerymobile cancel dialog.

Here's one possibility -- maybe a bit ugly because it's visible to
users who look in the address, but at least it may be a start...

You could change the link format so that every link would always
append a ?prevpage=Mygroup.Mypage and then you would have access using
the appropriate $_GET['prevpage'].

I don't remember exactly how I accomplished changing the link format
(and I don't know whether it's the best way) but when I was doing my
PageHist recipe I changed all links so that they maintained a
?asof=<date> from page to page.  You can see how I did it by checking
out pagehist.php at http://www.pmwiki.org/wiki/Cookbook/PageHist.

Another option would be to simply set a value in $_SESSION each time
you load a page (you'll have to figure out where that can be done in
config.php in terms of when sessions are initialized - seems like I
had some trouble finding that point during some previous work but I've
forgotten the details).  You could keep a whole list of history (last
n pages) if you wanted to...  This has the benefit of not being
visible to the user.

HTH or at least gives some ideas that may get you started...

-Peter
Martin Kerz | 4 Feb 10:06
Gravatar

Link to last visited page

Hi there,

can I somehow get the $FullName of the last visited page before the current one?

I would love to have something like {<$FullName} in wikitrails. Has anyone ever done this? It would be
necessary for a cancel button in a jquerymobile cancel dialog.

Just to let you know what I'm working on: For the last three years Amnesty International Germany has used a
pmwiki based platform to administer its nationwide annual meeting. It works quite well and looks great.
For 2012 I'm working on porting it to jquerymobile. I'm already pretty far. 

This is what it looks like right now: http://www.box.com/s/79gsohk15q2t2zjfum0l

Thanks a lot for your help.

Martin
Mike Turco | 2 Feb 08:29
Picon
Gravatar

Difficulty implementing fox forms

I'm new to pmwiki and am having a problem taking in the "big picture".
If someone could please tell me what I'm doing wrong with the
following, I'd appreciate it. I've been trying really hard to read
through the documentation, and have been through a lot of it, but I'm
slightly lysdexic (sic) and am having problems getting through it all.

I have a test site I've setup for learning purposes at
http://crm.miketurco.com . On that site I have the pmwiki basic
install, along with fox forms, fox edit and fox delete. I also have
fox contacts setup, which I'm using as an example as I learn.

Test site: http://crm.miketurco.com
Password: Test.Wiki.123 (which applies to read, write and admin).

What I'm trying to do is setup a simple, flat, business management
database. As I see things, PTV's are like data fields, groups are like
tables, pages are like records and pagelists are like queries.

If you click the link that says NewBill in the sidebar, a form comes
up. You can fill out the form and hit Submit, and the page gets saved
"somewhere". I assume that the page is being saved in the NewBill
group, but... I'm not 100% sure on that.

If you then click on the Payables link, you'll see that I have some
data posted by that form does come up. One record shows up in part,
and I believe the blank lines are records from that group that would
be displayed if I had set things up right.

In my efforts to do this, I have created the NewBill form as well as
the BillList under Site/LocalTemplates.

In short: I want to enter multiple bills (one at a time) using the
NewBill form, and then display all of the bills when I click the
Payables link. I made some progress towards doing this with fox
contacts, but am not able to duplicate these results. Something is
missing and I can't put my finger on it.

Finally, I would like that when one clicks on a link to a bill from
the payables screen, the target pages opens up in an edit form. For
example, if you go to http://diligentwarrior.com/mtddemo/ and click on
the first active project, (which is now called Testy,) a form pops-up
that allows editing of the subject record.

If someone could please clue me in on the above, I'd appreciate it. If
I can get through this level of understanding, I'll be in a place
where I can layout all of the forms and so forth that I need.

Thanks for your help,

Mike
Martin Kerz | 1 Feb 21:44
Gravatar

How to apply data-rel to an anchor?

Hi there,

I try to apply a data-rel attribute to an anchor tag. I did the following in a custommarkup.php file

SDV($WikiStyle['jqdialoglink'], array('data-rel'=>'dialog', 'apply'=>'a'));

And tried the following syntax on my page:

* %jqdialoglink%[[PageActionsDialog1|This Page ]]%%

What I want to achieve is something like this:

<a class="wikilink" data-rel="dialog" href="/Wiki/PageActionsDialog1">This Page</a>

Unfortunately, the data-rel="dialog" isn't showing up. What am I missing here?

Thanks, as always, for your help!

Martin

Gmane