scottplan wrote on 16 Mar 2010 12:25
I've posted this elsewhere, but I'm thinking the question deserves its own subthread.
I've tested forms pretty thoroughly, with the hope that I can get to my holy grail: a form that takes what users give it, but reverts to a semi-sophisticated default when they don't. I've mapped it all out, with examples, and I'm just not there yet — the green cells are successes, the red ones are obstacles.
- For one thing, I can't do much with the data I collect via %%form_data{field}%%. I can't turn it into a link, pass it as a _template parameter, or plug it into a tricky include. Is this because form fields (symbols?) are compiled later?
- Default values are kludgy. Assuming form fields are eventually living, useful pieces of data, I'd like the resulting page to adapt when certain data is missing. For instance, if a user doesn't provide an email, let's show their username instead. If a user doesn't point to an offsite image, let's look for one attached to the page instead. I'd prefer not to show to the user any @@ (from a tricky include), or :first (even if I did, they don't work anyway). Instead the _template should be able to respond to the data and revert to the right code. Can't do that yet.
- I think I could get there if includes recognized the data passed to them via forms. I could pass a null value, then ignore it and assign a default value instead.
I'm open to suggestion for how to work with the existing compile sequence. But if there's no way to get there, I'd surely appreciate a way to make form data more useful.
So I'm wondering. James wanted forms to be accessible via CSIs. I want form data to be available for includes. Is it possible to have it both ways?
Hey Scott,
Fortunately forms ARE accessible via CSIs now, after a Wikidot update.
But form data with includes… it can be done. I don't have time right now, but I'll show you in 12 hours.
Having said that, there are things that CAN NOT be done with %% variables and includes, due to this bug.
I'm very interested. Looking forward to seeing what you've got!
Aww, I know I said I'd show you in 12 hours… but it's a work-in-progress. I feel reluctant to show something that isn't finished yet.
Sorry!
But it is really cool !!!
The suspense is killing me. Thanks for taking it on.
Coming back to this again.
James, I've read your include how-to's with interest, and your discussion with Rurwin taught me some nuances. But none of it seems to engage directly with this question. How to include form data so it's useful?
Specifically, can I get the include to ignore a null value entered in a form?
If I can get through this question, my life as a wiki-admin will be ever so much easier. Thanks for your help.
Things have been pretty quiet around these parts. No discussion over the last couple weeks.
I've taken the winter/spring to retool our site, and I've engaged pretty actively with dataforms/templates/listpages/includes, hoping to turn them into a seamless tool for our neighborhood outreach. I was really hoping to have a working model for our wiki's centerpiece using data forms. But my window for this big retrofit is coming to a close, and it looks like I'll have to resort to basic includes instead.
If there's something in the works soon, I'd love to know about it. Otherwise this'll just be our road not taken.
We are finishing data form file field, then work with data forms will be halted for a some time due to other stuff like UI simplifying. When we made planned improvements for wide range wikidot users we will back to data forms again.
Bartłomiej Bąkowski @ Wikidot Inc.
';.;' TeRq (Write PM)
Could you please also work on a URL field too, before halting data form progress?
Yes, its quite easy to do :) it's like a sneeze in relation to the file upload field.
Bartłomiej Bąkowski @ Wikidot Inc.
';.;' TeRq (Write PM)
That sounds positive — thanks Bartłomiej.
4 specific questions:
That would be very useful.
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
ad 1. if %%form_data{ImageURL}%% will be url type field, it will work,
ad 2 probably yes, as this:
is also a valid url
ad 3. rater not, but considerable,
ad 4. just guessing:
if %%form_data{ImageURL}|isTrue%% give us string "true" its show us "// show if true" well, maybe its to difficult
designt http://projects.wikidot.com/thread:233 could help as a little see "Text field filters"
Bartłomiej Bąkowski @ Wikidot Inc.
';.;' TeRq (Write PM)
If statements would be really powerful.
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
Conditionals would be insanely helpful.
An [[if]] tag is just an idea… now a days we thought about "beta stage" for some wiki syntax/features (possible back incompatibilities in next development steps, even cancel/delete of whole idea)
We could bring some features in "beta stage" faster… maybe an [[if]] tag to (can't say when exactly)
In nearest pipe line is ("UI improvement" and "monthly payment"), then we consider what is most important for next steps.
have no idea what it means
Bartłomiej Bąkowski @ Wikidot Inc.
';.;' TeRq (Write PM)
OK — that URL field might be the best I can hope for then, given your other priorities. I'd be really open to beta testing, assuming it could be applied on a per-site basis.
"front-burner" "back-burner" is an idiom about the immediacy of something. If your pot of soup won't be done for awhile and can simmer without any attention, you push it to the back burner & work on other things at the front of the stove.
"Like sneezing" must be a Polish idiom. There, we've traded.
Awesome :)
As the 'image' field is similar in function to the 'file' field, will that be completed at the same time, or will it be completed after the UI improvements?
If it is not going to be done soon, I can use the new 'file' field as a workaround for now… (so I can easily wait), but would prefer to have both at the same time (assuming that it isn't too much extra work for you to add 'image' as well)
Cheers,
Shane
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
:> we will see.
Bartłomiej Bąkowski @ Wikidot Inc.
';.;' TeRq (Write PM)
Like I said, doesn't bother me either way, just wondering :)
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
Cant finish URL field due to php bug
I also try to use regular expression:
from this site, but it's not good enough.
Bartłomiej Bąkowski @ Wikidot Inc.
';.;' TeRq (Write PM)
What's wrong with using a regular expression? I mean, why is it not good enough?
It just don't allow some valid URL-s and right now i don't have time to improve those regexp. But if someone improve it, I will use it. Here is RFC 1738.
Bartłomiej Bąkowski @ Wikidot Inc.
';.;' TeRq (Write PM)
TeRq's issue is out of my league. But it sure would be nice to have a URL field. Can anyone else address this question please?
I think we add those REGEXP, and we improve it later… PHP team sad that this bug is fixed (in PHP 5.2.14-dev, in 5.2.13 to… but wont work in my MAC PHP 5.2.13).
Bartłomiej Bąkowski @ Wikidot Inc.
';.;' TeRq (Write PM)