|
List Info
Thread: page content shows on wrong page
|
|
| page content shows on wrong page |
  United Kingdom |
2007-05-02 07:04:33 |
I would like some help to sort out the display of messages.
When the FoxAbort function is called, I get this strange
result:
The wiki HomePage is displayed, with url and title, but the
page text
is the content of $pagename (the form page, which has the
(:messages
markup), with the error message.
This is very confusing. Function HandleBrowse shows the
right content,
but in the wrong frame, i.e. ScriptUrl wiki HomePage.
The error messaging function in Fox is:
function FoxAbort($pagename, $msg) {
global $MessagesFmt;
$MessagesFmt[] = "<h5
class='wikimessage'>$[$msg]</h5>";
HandleBrowse($pagename);
exit;
}
This can be called from within other functions to abort
proceedings
with an appropriate message, displayed by (:messages markup.
Like
FoxAbort($pagename, "Sorry, page exists already.
Please choose another page name. ");
Could someone pease check this and tell me what to do?
Thanks,
Hans
_______________________________________________
pmwiki-devel mailing list
pmwiki-devel pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel
|
|
| Re: page content shows on wrong page |
  United States |
2007-05-02 09:27:19 |
On Wed, May 02, 2007 at 01:04:33PM +0100, Hans wrote:
> I would like some help to sort out the display of
messages.
> When the FoxAbort function is called, I get this
strange result:
>
> The wiki HomePage is displayed, with url and title, but
the page text
> is the content of $pagename (the form page, which has
the (:messages
> markup), with the error message.
> This is very confusing. Function HandleBrowse shows the
right content,
> but in the wrong frame, i.e. ScriptUrl wiki HomePage.
> ...
> Could someone pease check this and tell me what to do?
I think I'll need a url that shows the exact problem before
I can be of much help.
Pm
_______________________________________________
pmwiki-devel mailing list
pmwiki-devel pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel
|
|
| Re: page content shows on wrong page |
  United Kingdom |
2007-05-02 09:48:16 |
Wednesday, May 2, 2007, 3:27:19 PM, Patrick wrote:
> I think I'll need a url that shows the exact problem
before
> I can be of much help.
http://sof
tflow.co.uk/clean/Fox/NewPageBox
use either form to create a new page in a different group,
which is
not allowed. See the result.
Hans
_______________________________________________
pmwiki-devel mailing list
pmwiki-devel pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel
|
|
| Re: page content shows on wrong page |
  United States |
2007-05-02 10:08:01 |
On Wed, May 02, 2007 at 03:48:16PM +0100, Hans wrote:
> Wednesday, May 2, 2007, 3:27:19 PM, Patrick wrote:
>
> > I think I'll need a url that shows the exact
problem before
> > I can be of much help.
>
> http://sof
tflow.co.uk/clean/Fox/NewPageBox
>
> use either form to create a new page in a different
group, which is
> not allowed. See the result.
Your form is being submitted as
<form action='http://softflow.co.uk/cle
an' method='post' >
which means that $pagename has a value of '' when PmWiki is
executed. Then when ResolvePageName() is called, it
becomes
Main.HomePage.
In this case I suspect the skin is using the wrong value
of pagename when it generates its headers/footers ... what
happens if you try this with the default pmwiki skin?
Pm
_______________________________________________
pmwiki-devel mailing list
pmwiki-devel pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel
|
|
| Re: page content shows on wrong page |
  United Kingdom |
2007-05-02 10:13:02 |
Wednesday, May 2, 2007, 4:08:01 PM, Patrick wrote:
> In this case I suspect the skin is using the wrong
value
> of pagename when it generates its headers/footers ...
what
> happens if you try this with the default pmwiki skin?
see now.
The page title is okay. The url is script url though,
so clicking the View link takes you to HomePage.
Hans
_______________________________________________
pmwiki-devel mailing list
pmwiki-devel pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel
|
|
| Re: page content shows on wrong page |
  United States |
2007-05-02 10:25:59 |
On Wed, May 02, 2007 at 04:13:02PM +0100, Hans wrote:
> Wednesday, May 2, 2007, 4:08:01 PM, Patrick wrote:
>
> > In this case I suspect the skin is using the wrong
value
> > of pagename when it generates its headers/footers
... what
> > happens if you try this with the default pmwiki
skin?
>
> see now.
> The page title is okay. The url is script url though,
> so clicking the View link takes you to HomePage.
I think the action= value of the form should be {$PageUrl}
instead of {$ScriptUrl}. That way if the post fails,
the user is correctly placed on the page that contained
the form and not Main.HomePage.
Remember your question yesterday about why I used
action={$PageUrl} in the form instead of action={$ScriptUrl}
?
This is one reason why.
Pm
_______________________________________________
pmwiki-devel mailing list
pmwiki-devel pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel
|
|
| Re: page content shows on wrong page |
  United Kingdom |
2007-05-02 11:23:07 |
Wednesday, May 2, 2007, 4:25:59 PM, Patrick wrote:
> I think the action= value of the form should be
{$PageUrl}
> instead of {$ScriptUrl}. That way if the post fails,
> the user is correctly placed on the page that
contained
> the form and not Main.HomePage.
Yes, but I am failing to get the right php code for this.
The (:fox .. markup
defines for output
"<form action='$ScriptUrl' method='post' ".
....
If I change the above $ScriptUrl to $PageUrl (and declare
global $PageUrl)
I get action='' in the HTML output.
If I use
"<form action='{$PageUrl}' method='post' ".
....
or
"<form action='".$PageUrl."'
method='post' ". ....
I don't get an action either. So I have not learned how to
insert the
variable. Why does $ScriptUrl work fine inside the markup
function,
but $PageUrl is not? What am I missing? $PageUrl is empty.
How do I
get a value for it inside the markup function?
Hans
_______________________________________________
pmwiki-devel mailing list
pmwiki-devel pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel
|
|
| Re: page content shows on wrong page |
  United Kingdom |
2007-05-02 11:30:30 |
Wednesday, May 2, 2007, 5:23:07 PM, Hans wrote:
> What am I missing? $PageUrl is empty. How do I
> get a value for it inside the markup function?
the answer seems to be
$PageUrl = PageVar($pagename, '$PageUrl');
Hans
_______________________________________________
pmwiki-devel mailing list
pmwiki-devel pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel
|
|
| Re: page content shows on wrong page |
  United States |
2007-05-02 11:36:20 |
On Wed, May 02, 2007 at 05:23:07PM +0100, Hans wrote:
> Wednesday, May 2, 2007, 4:25:59 PM, Patrick wrote:
> > I think the action= value of the form should be
{$PageUrl}
> > instead of {$ScriptUrl}. That way if the post
fails,
> > the user is correctly placed on the page that
contained
> > the form and not Main.HomePage.
>
> Yes, but I am failing to get the right php code for
this.
> The (:fox .. markup
defines for output
>
> "<form action='$ScriptUrl' method='post'
".
> ....
>
> If I change the above $ScriptUrl to $PageUrl (and
declare global $PageUrl)
> I get action='' in the HTML output.
>
> If I use
>
> "<form action='{$PageUrl}' method='post'
". ....
> or
> "<form action='".$PageUrl."'
method='post' ". ....
>
> I don't get an action either. So I have not learned how
to insert the
> variable. Why does $ScriptUrl work fine inside the
markup function,
> but $PageUrl is not?
Because $PageUrl is a *page variable*, not a global
variable.
In order to determine the url of a page, we have to know
the
name of the page (which might not be the same as the
currently
displayed page).
To get the value of a page variable, use PageVar():
"<form action='" . PageVar($pagename,
'$PageUrl') . "' ... "
Pm
_______________________________________________
pmwiki-devel mailing list
pmwiki-devel pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel
|
|
| Re: page content shows on wrong page |
  United Kingdom |
2007-05-02 13:57:05 |
Wednesday, May 2, 2007, 5:36:20 PM, Patrick wrote:
> Because $PageUrl is a *page variable*, not a global
variable.
> In order to determine the url of a page, we have to
know the
> name of the page (which might not be the same as the
currently
> displayed page).
> To get the value of a page variable, use PageVar():
> "<form action='" . PageVar($pagename,
'$PageUrl') . "' ... "
Thank you! This is working just fine and I will adopt it.
Can you tell why the following is also working:
"<form action='{$PageUrl}' method='post'
". " ...."
It displays the right page url. But in the HTML it reads
<form action='{$PageUrl}' method='post' >
which looks a bit dodgy.
Hans
_______________________________________________
pmwiki-devel mailing list
pmwiki-devel pmichaud.com
http://www.pmichaud.com/mailman/listinfo/pmwiki-devel
|
|
|
|