Extension talk:Page Forms

Create forms automatically
Hello, i've done a form to create a personal page (user caracteritics) and i would create automatically a new form for each new user who create an new account on my wiki then, i would like a user to update only the page that bears his name Is it possible? And how can i do? thanks for your answers


 * You probably mean create a new page, not create a new form. You can do this by making this form the default form for the "User" namespace, in addition to using Extension:KeepYourHandsToYourself. Yaron Koren 01:58, 7 July 2010 (UTC)


 * yes i mean create a new page. But which file do i edit to modify the default form for the "User" namespace?
 * Eva 09:30, 7 July 2010 (UTC)


 * See here. Yaron Koren 12:54, 7 July 2010 (UTC)


 * I've managed to do this but i've some problem with the display. I've one part on the left side and an other part in a sort of box (a box called as User, here it's called Eva) and it create some links to non-existent pages but my fields are not of type page


 * Eva 13:39, 8 July 2010 (UTC)


 * If you don't define a type for a property, by default it will be of type "Page" - I assume that's the issue here. Yaron Koren 14:27, 8 July 2010 (UTC)

Show on select question
Hi,

I have been trying to set up a form using "show on select" in the section. There is an interconnected set of choices i.e. choices for field1 are field2, choices for field2 are field3 and so on till field5. A typical field is set up as follows

I want only field1 to show up in the beginning and depending on what the user chooses, show up appropriate choices in field2 and so on. I think i have set up the fields properly, but evidence - the form not showing up correctly - goes against that. many of the "next" fields -field3,field4,field5 etc. - show up even before field1 is selected. but when i select field1, extra fields - with the correct choices in the dropdown menu based on field1 choice - show up while the previously displayed incorrect fields still are very much there.

i would be really glad if someone could provide me some help on how to get the form set up correctly and avoid showing the "next" fields till the "previous" choices are selected. Pointers to some existing code would also be greatly appreciated.

Thanks a lot! Veryhuman 01:09, 8 July 2010 (UTC)

Preview won't work
I have installed Semantic MediaWiki + Semantic Forms, and everything works fine except one aspect. When I use a form to create or edit a page, if I press the "show preview" (I'm not sure of the English translation) button, it starts loading something but it never ends. The only way to use my forms is to fill in the gaps, and press the "show differences/changes". Then I can press "show preview", but my users don't know this way. I have tried with the same form and the same template in another wiki which has another installation of the Semantic Forms and it works. Thanks for your help. --Wikypedista 00:15, 9 July 2010 (UTC)


 * I've had the same problem, but have assumed that parsing data from forms and displaying it as preview would be kinda difficult. I dont really need the preview function though... Veryhuman 02:14, 9 July 2010 (UTC)


 * Sometimes it does take a long time - you can solve this problem easily, by removing the line in the form that starts with '<div id="wikiPreview"...'. Yaron Koren 14:22, 9 July 2010 (UTC)


 * Wow, thank you so much, Yaron Koren. This problem has taken me crazy for months. I have thanked your help in my wiki. I don't still understand what was wrong with that line and what is it's purpose, but at least it works perfectly! --Wikypedista 11:42, 10 July 2010 (UTC)

blank screen uploadwindow
Sorry, its me again Burgy Zapp with Semantic Forms update to version 1.9.1 problem on MediaWiki 1.12.4 with an error:
 * Call to undefined function wfStripIllegalFilenameChars in /var/www/vhosts/kunstbewegung.info/httpdocs/wikide7/extensions/SemanticForms/specials/SF_UploadWindow.php on line 423

In Order to fix the call to an yet non existing funktion in MW 1.12.4 you need to add this function wfStripIllegalFilenameChars( $name ) { $name = wfBaseName( $name ); $name = preg_replace ( "/[^".Title::legalChars."]|:/", '-', $name ); return $name; } to your GlobalFunction.php but beware, it is actually a hac to add a funktion into original files. Sincerely Yours Burgy

blank form after update
I did update Semantic Forms to version 1.9.1 (MW 1.12.4), since then the actual form (2 step process) is shown as blank page. I hope somebody can hint me to the problem. Sincerely Yours Burgy Zapp


 * Hi - this might help debug the issue. Yaron Koren 23:55, 11 July 2010 (UTC)

 Thank you very much. First of all it might seem that proc open function is necessary, but I can not validate that information. But after activating it, I got a more helpful error message:
 * Fatal error: Call to private method Xml::expandattributes from context 'SFFormUtils' in /var/www/vhosts/kunstbewegung.info/httpdocs/wikide7/extensions/SemanticForms/includes/SF_FormUtils.php on line 457

and was able to fix it with this LINK (Problem with "edit with form"), as information I want to share my php version: 5.1.6 (apache2handler).  By the way ;-) Thank you Yaron for pushing the borders of semantic information infrastructure with your much appreciated work!

Suggestion: Preserve location of template in the markup
I set it up so that pages in the Template namespace use a form. The purpose is to allow standardized documentation of every template, so that it will require an act of will not to provide any. There's just one catch: the SemanticForms extension insists that the template associated with the form appear first. This means that if I put the template inside of a &lt;noinclude&gt; tag, where it belongs, then edit using the form, then when I save it the template is back outside the &lt;noinclude&gt; tag.

Any objection to making it preserve the location of the template in the markup? Is there any particular reason why it doesn't already? Is this going to be a hard thing to do?

Thanks for any feedback you might have.

-- John at Irie dash Inc dot com


 * Hi - it sounds like the issue you're asking about is preserving the order of free text, template call, free text, etc. Partial forms might work better for that case, although only for editing existing template pages. I'd say a cleaner solution, though, would be to have a separate page for the full documentation - maybe at Template:Template-name/doc. Yaron Koren 00:13, 12 July 2010 (UTC)

Where can I view/change property details?
I defined a Property, ProgramTitleEN, which is defined as follows: This is a property of type Has type::String.

It is used in the form as follows: ! Program Title (English):

It is used in the template as follows: ! Program Title (English):
 * Program Title (English)::

On a page that uses the form, in Firebug it shows up like this: 

Where is "cols=80" coming from, and how can I change it? Stlauc 18:55, 12 July 2010 (UTC)


 * That's strange - it looks like a bug in SF; it could be that your (unnecessary) setting of "rows" is confusing it. Yaron Koren 20:22, 12 July 2010 (UTC)

Displaying bullets in forms
1. I want to display a list of categories as a bullet list. The first bullet appears correctly, but subsequent bullets are appended to the first one as follows: OBPG Advice&amp;Consultation *OBPG Entrepreneurship 

This is the template code to insert the wikitext: 2. Also, in a text area I want to use wikitext for a bullet list, so I entered this wikitext: *Updated keywords *Changed URL

It displayed as an asterisk on line 1 and a bullet on line 2.

Can anyone see the errors? Stlauc 19:27, 12 July 2010 (UTC)


 * For the first issue - use "\n" instead of "&lt;br&gt;"; for the second, this is probably the answer. Yaron Koren 20:20, 12 July 2010 (UTC)

1. This works great - thanks Yaron: 2. Got it - In the template, you need to place the field in column one of a new line, E.g., ! My label: '''3. I found a new, deal-breaker issue with "&" characters in category names. They cause me to lose data.''' For example, my initial data when I click "Edit" is this: Any help on this critical issue would be much appreciated. Stlauc 15:21, 13 July 2010 (UTC). Logged as a bug, Stlauc 18:53, 15 July 2010 (UTC)
 * OBPGCategories=OBPG Advice&Consultation, OBPG Entrepreneurship
 * However, when I click "Edit with form", only "OBPG Entrepreneurship" is selected. Therefore I drop "Advice & Consultation" whenever I save the form. This is a serious issue and I've isolated it to the "&" in the category name, e.g., Category:OBPG_Advice&Consultation.
 * My form code is this:
 * My template code is this:

Show on select seems to be broken
I tried to setup show on select as in: here, but instead of producing a drop down menu as expected, it is instead creating a standard text entry field. I was able to replicate this problem: here in addition to my private wiki. I do not know what about the DiscourseDB site is set differently which is allowing it to instead be a drop down selection. I even tried explicitly setting input type to drop down, but it still remains a text entry. Not sure what's wrong here. Thorncrag 00:09, 13 July 2010 (UTC)


 * I am having the same problem. I followed exactly the code on DiscourseDB, but doesnt work. Have been fiddling with different options for 3 days now. Veryhuman 05:24, 18 July 2010 (UTC)


 * That seems unrelated to "show on select" - the issue there is just that the input needs to have a pre-defined set of allowed values for it to be a dropdown. In the case of the Discourse DB form, those allowed values are defined on the corresponding property page. Yaron Koren 16:06, 18 July 2010 (UTC)
 * That the values are defined by a property makes sense, except that how exactly is the Property:Publication type associated to the field "type"? I think this is the bit that is less than straightforward.  Thorncrag 19:07, 18 July 2010 (UTC)


 * Ah - the two are associated in the template, which SF parses when it creates the form. Yaron Koren 00:10, 19 July 2010 (UTC)


 * Hi Yaron, Thanks again for your reply, but I'm not sure if I understand correctly. I have a property (Medicinal significance) of type Boolean with allowed values Yes and No. I have even tried changing property type to String. The field is structured like this   with   and   following. The values show as dropdown alright. But still the fields which are supposed to show up after selecting Yes (medicinal details) or No (no med details) show up even before that. Am I missing something? I wonder whether Thorncrag got his problem resolved with your reply? Thanks Veryhuman 02:25, 19 July 2010 (UTC)


 * Hi - that doesn't sound like the same problem; it sounds like a totally different problem. I don't know what's causing it, but your property should either be a Boolean with no allowed values, or a String with allowed values. Yaron Koren 10:40, 19 July 2010 (UTC)


 * Thanks Yaron. Will post a solution here if I find one. Veryhuman 14:53, 19 July 2010 (UTC)

I haven't had time to revisit this just yet, but I will share what I learn when I do. Thorncrag 18:37, 21 July 2010 (UTC)

Add a template for each edit?
Is it possible to add a template for each form edit, rather than for the form edit to make a new templatre? IE If I edit Forum with form edit, could I make it so this template appears every time I edit with form? Thanks in advance--Technobliterator 08:33, 21 July 2010 (UTC)


 * No, that's not possible. If your goal is to create a forum, you might be better off using the Liquid Threads extension. Yaron Koren 13:15, 21 July 2010 (UTC)

Learning Process
Hi people!

I'm here learning Semantic Forms to apply on my Wiki. Some questions:

1. I'm making a Wiki about a city in Brazil. I'd like to have stantard information form Hotels, Restaurants, etc. I think Forms would help a lot! But, I don't know if I'm using it properly. I have created properties like:

a. Property:Hotel_Room_TV Property type Has type::String Prossible values:
 * Allows value::No
 * Allows value::Yes

b. Property:Hotel_Pool Property type Has type::String Prossible values:
 * Allows value::No
 * Allows value::Yes

c. Etc

The result is something like this: http://www.wikirio.com.br/Caesar_Park_Hotel

Is it ok? What do you guys think?

2. On the same page http://www.wikirio.com.br/Caesar_Park_Hotel how can I remove the red links on Sim/Não (Yes/No)?

3. How can I insert a file name I updated using Forms "[[Image:[[Picture_1::]]" on a Wiki image: |style=" vertical-align: top;"|[[Image:[[Picture_1::]]|none|thumb|Pictures]]. Is there something like concatenate? (The problem is on the same page http://www.wikirio.com.br/Caesar_Park_Hotel)

Regards, Edgard.


 * Hi - for the properties, they should be of type "Boolean" instead. For the image, you should separate out the display from the property setting - have something like " [[Image:|none|thumb|Pictures]] Picture_1::Image: ". Yaron Koren 14:42, 21 July 2010 (UTC)


 * Yo! Thanks for the reply. I did not use bloolean beacause some answers, like ROOM INTERNET, could be "No", "Yes, free" and "Yes, paid". Edgard...

Is there any way to put a default form edit in a template? Like, does page has default form::foo work? Oh and thanks for your other answers.--Technobliterator 18:51, 28 July 2010 (UTC)


 * You're asking whether a feature listed in the documentation actually works? Er, yes it does... Yaron Koren 21:12, 28 July 2010 (UTC)

User does not fill in all the entries..
Hello. If a user does not fill in all the entries to a form and submits it, how can you make it so the final page does not show the property (ex. ) in the spot where the user did not enter data for.

Instead I would like it to show a blank or even a link saying "ADD" that will link to the form edit page where those values are blank.

Thanks. Anyone know?


 * use parser function in the templateMsevero 02:15, 1 August 2010 (UTC)


 * You should change to  - there's a way to do the "add" link thing too, but I wouldn't recommend it. Yaron Koren 15:50, 1 August 2010 (UTC)


 * Awesome, thanks a lot both of you. And Yaron, why do you recommend not doing that? Just curious.--65.87.227.156 17:55, 1 August 2010 (UTC)


 * I just think it looks awkward to have "add data" links all over the place. I mean, I'd think most people could figure that they can use the "edit with form" tab to add missing information. Yaron Koren 23:31, 1 August 2010 (UTC)

Unsupported type "_geo" defined for property.
I get this. Noted it is even on http://halo-smw.ontoprise.com/lod/index.php?title=Wikitext_programming_workshop_1&action=annotate So, my system is MediaWiki 1.15.1, PHP 5.3.2-1ubuntu4.2 (apache2handler), MySQL 5.1.41-3ubuntu12.3, Forms 1.9.1 built from Semantic Bundle (Version 0.4.2.20100719). I even typed a real simple deal to input and display a simple address and still get the error. Is this a bug or am I doing something wrong? Below is my simple form:

The template:

How it looks in Edit:

This is the "testaddress" template. It should be called in the following format:

Edit the page to see the template text.

Didn't know how to pull the property for Freight Yard Coordinates, but it was defined in properties using the geocode dropdown.

This might be all user error; I don't know, but I found it odd that the ontoprise site has the same issue. Thanx.


 * This isn't a Semantic Forms issue - it's because the handling for the "geographical coordinate" type moved from Semantic MediaWiki to Semantic Maps. Yaron Koren 15:16, 2 August 2010 (UTC)

So, I guess the next question becomes how to solve it? I mean do I need to learn some new programming; do I sacrifice the ability to add a map in forms, what specifically do I need to do? Thanx --Vincit Omnia Veritas 21:47, 2 August 2010 (UTC)