Allowing options if the page exists

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Allowing options if the page exists

pipi69e5
Hi friends!

I'm using Special:AddData to create a new page, and page title is
derived from a value of a field across 'page name' parameter of {{{info
tag. If the page exists, the new one overrides it. How can I warn the
user the existing page, or how can I allow two options for him/her:
1. ) Override.
2. ) Go to existing page or editing the old page with form.

Many thanks: PiPi


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Allowing options if the page exists

Yaron Koren
Hi,

Sorry for the late reply. Unfortunately, there's no direct way to do this. One possibility is to include the "<unique number>" tag within 'page name', so that, if a page of that name already exists, the user will instead create a page with ' 1' a the end of it, which should make it more obvious that there's redundancy. Another possibility is to use the more conventional two-step approach (using #forminput), with instructions to the user on how to structure the page title.

-Yaron


On Wed, Aug 5, 2009 at 5:39 PM, pipi <[hidden email]> wrote:
Hi friends!

I'm using Special:AddData to create a new page, and page title is
derived from a value of a field across 'page name' parameter of {{{info
tag. If the page exists, the new one overrides it. How can I warn the
user the existing page, or how can I allow two options for him/her:
1. ) Override.
2. ) Go to existing page or editing the old page with form.

Many thanks: PiPi


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Allowing options if the page exists

jdpond
In reply to this post by pipi69e5
Here's a way around this that will edit the exiting information if it
exists, otherwise create and edit new page - although admittedly not
elegant.  Also, according to the Extension:Semantic_Forms documentation:

Special:EditData - lets a user edit an existing page using a user-defined
form. (See example of page) This page is somewhat deprecated. (the "somewhat
deprecated" clause bothers me)

Assumption:  You have Extension:ParserFunctions loaded

[[ {{#ifexist: <<your page name>> | Special:EditData/<<your form
name>>/<<your page name>> | Special:AddData/<<your form name>>/<<your page
name>> }} | <<your link text>>]]

Example:
<<your page name>> = Example Page
<<your form name>> = Example Form
<<your text name>> = Click here to edit

[[ {{#ifexist: Example Page | Special:EditData/Example Form/Example Page |
Special:AddData/Example Form/Example Page }} | Click here to edit]]


> -----Original Message-----
> From: pipi [mailto:[hidden email]]
> Sent: Wednesday, August 05, 2009 5:40 PM
> To: SMW user list
> Subject: [Semediawiki-user] Allowing options if the page exists
>
> Hi friends!
>
> I'm using Special:AddData to create a new page, and page
> title is derived from a value of a field across 'page name'
> parameter of {{{info tag. If the page exists, the new one
> overrides it. How can I warn the user the existing page, or
> how can I allow two options for him/her:
> 1. ) Override.
> 2. ) Go to existing page or editing the old page with form.
>
> Many thanks: PiPi
>
>
> --------------------------------------------------------------
> ----------------
> Let Crystal Reports handle the reporting - Free Crystal
> Reports 2008 30-Day trial. Simplify your report design,
> integration and deployment - and focus on what you do best,
> core application coding. Discover what's new with Crystal
> Reports now.  http://p.sf.net/sfu/bobj-july 
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Allowing options if the page exists

Yaron Koren
You're right about that strange "somewhat deprecated" comment in the SF documentation - that's an old note that no longer really makes sense, if it ever did. I removed it.

-Yaron

On Thu, Aug 13, 2009 at 6:22 PM, Jack D. Pond <[hidden email]> wrote:
Here's a way around this that will edit the exiting information if it
exists, otherwise create and edit new page - although admittedly not
elegant.  Also, according to the Extension:Semantic_Forms documentation:

Special:EditData - lets a user edit an existing page using a user-defined
form. (See example of page) This page is somewhat deprecated. (the "somewhat
deprecated" clause bothers me)

Assumption:  You have Extension:ParserFunctions loaded

[[ {{#ifexist: <<your page name>> | Special:EditData/<<your form
name>>/<<your page name>> | Special:AddData/<<your form name>>/<<your page
name>> }} | <<your link text>>]]

Example:
<<your page name>> = Example Page
<<your form name>> = Example Form
<<your text name>> = Click here to edit

[[ {{#ifexist: Example Page | Special:EditData/Example Form/Example Page |
Special:AddData/Example Form/Example Page }} | Click here to edit]]


> -----Original Message-----
> From: pipi [mailto:[hidden email]]
> Sent: Wednesday, August 05, 2009 5:40 PM
> To: SMW user list
> Subject: [Semediawiki-user] Allowing options if the page exists
>
> Hi friends!
>
> I'm using Special:AddData to create a new page, and page
> title is derived from a value of a field across 'page name'
> parameter of {{{info tag. If the page exists, the new one
> overrides it. How can I warn the user the existing page, or
> how can I allow two options for him/her:
> 1. ) Override.
> 2. ) Go to existing page or editing the old page with form.
>
> Many thanks: PiPi
>
>
> --------------------------------------------------------------
> ----------------
> Let Crystal Reports handle the reporting - Free Crystal
> Reports 2008 30-Day trial. Simplify your report design,
> integration and deployment - and focus on what you do best,
> core application coding. Discover what's new with Crystal
> Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user