rmswope
I'm trying to create several pages when a form is submitted, but the names of the new pages are only taking the variable names.
Here's an example:
<form>
action template ! programs :
labels MyLabels
addpage forms:record :data:sites:@@State@@:@@type@@:@@Initials@@
addpage forms:redirect :pages:location:@@Initials@@
addpage forms:display :pages:location:@@name@@
Thanks "Your info has been submitted."
select "type" "|Office|Branch|Other" ^
textbox "name"
textbox "Address"
textbox "Address 2" !
textbox "Address 3" !
textbox "City"
textbox "State"
textbox "zip" !
textbox "phone" /^[0-9 \/()+\-]+$/
textbox "Initials"
fieldset
submit "Submit"
</form>
The result is that three pages get created and the content on those pages is just like the template, but the names of the pages are the variables. See below:
programs:data:sites:@@State@@:@@type@@:@@Initials@@
programs:pages:location:@@Initials@@
programs:pages:location:@@name@@
As you can see placeholders are not being replaced by the values. Any ideas?
rmswope
Just in case anyone has this same issue, I found a solution. After a lot of trial and error, I found that you can add multiple action statements. See example below:
<form>
action template forms:record programs:data:sites:@@State@@:@@type@@:@@City@@:@@Initials@@ :
action template forms:redirect programs:pages:location:@@Initials@@ :
action template forms:display programs:pages:location:@@name@@ :
labels MyLabels
Thanks "Your info has been submitted."
select "type" "|Office|Branch|Other" ^
textbox "name"
textbox "Address"
textbox "Address 2" !
textbox "Address 3" !
textbox "City"
textbox "State"
textbox "zip" !
textbox "phone" /^[0-9 \/()+\-]+$/
textbox "Initials"
fieldset
submit "Submit"
</form>
This results in three pages being created in the correct locations and dynamically named based on user input.
arne78
Hi all,
I want to follow up on the addpage issue. I searched the forum but did not find any solution. I managed with the bureaucracy plugin a really cool project set up where people can put in their project and a complete project page with a landing page, different subpabes based on data put in is automatically set up etc. just like RMSwope did, really fantastic. To finalize and put it in operation I just have to finish one last issue.
The landing page is the "customer name". So it shall just be done first time and when the second time the customer name is entered it shall set up a project under that name as well, the overview-page shallbe "untouched" because it updates itself by tags I set up in the templates...
I try to do it this way (I just show my test page to solve the problem, but I test now for hours and don´t get it running, the following is the closest):
====== addpage **TEST-TEMPLATE**======
<form>
action template wiki:test-sample-project-template projects项目:bureaucracy-test:10:@@project-customer@@:@@project-name@@
fieldset
textbox "Project-Customer"
textbox "Project-name"
yesno "New-customer?"
fieldset "add page" "New customer?"
addpage wiki:test-sample-project-template-general projects项目:bureaucracy-test:10:@@Project-Customer@@
fieldset
submit
</form>
When I put now in this as "Project-Customer" the name "Arne" and for Project-Name the name "project2" as example it opens the addpage under "projects项目:bureaucracy-test:10:arne:project2:projects项目:bureaucracy-test:10:project-customer", so it ignores my project-customer naming "Arne" and besides that the template-page " projects项目:bureaucracy-test:10:@@project-customer@@:@@project-name@@" is set up right...
But the addpage should be set up under "projects项目:bureaucracy-test:10:arne" - but this does not happen... whatever I try or do.
Anybody can help me on the right code? I would be incredible thankful.
Best regards
Arne
arne78
Hi all,
hopefully it helps somebody later who searches for problems with addpage. I solved the issue by doing the following. So the "trick" is to first open the right path with a first empty template and then write into this path what you want by the addpage function by not taking a path but just writing ".."
For me, all problems solved for now for a great project-page-formular :)
====== addpage **TEST-TEMPLATE**======
<form>
action template : projects项目:bureaucracy-test:10:@@project-customer@@
fieldset
textbox "Project-Customer"
textbox "Project-name"
yesno "New-customer?"
fieldset "add page" "New customer?"
addpage wiki:test-sample-project-template-general ..
fieldset
submit
</form>
arne78
Hi all,
with adding this line
action template : projects项目:bureaucracy-test:10:@@project-customer@@
addpage works fine when there is NO @@project-customer@@ page set up. Yet when it is existing already it delivers a fault message... so it was a dead end...
The task is to set up the customer page @@project-customer@@ when you click (e.g. by yesno) that it does not exist and put all other action templates under this path.
Whatever I tried, I can´t make it happen that this works stable. Any idea? Support would be greatly appreciated!
Regards
Arne
marguz
Hey Arne78,
Would you be able to share this Project process with us? It sounds like something I tried (and failed) to do with my team.
thanks.