Extension talk:Page Forms

SF without SMW?
This may sound stupid but I don't use any semantic functionality, and all I want is the forms (the fields don't even need to have the semantic properties). Is there a way to use just the forms extension without SMW. If not, is there a way to disable as much as possible semantic functionality (not to drag resources). Thanks so much! --79.116.10.225 16:11, 1 April 2014 (UTC)


 * Unfortunately, no - you'll have to install SMW. If you don't use any of the SMW functionality, though, its presence shouldn't have any real impact on performance. Yaron Koren (talk) 00:30, 2 April 2014 (UTC)

Removing Empty Paramters
I'm in the process of adding semantic forms to the RPG wiki I run. All of the pages I'm currently adding a form for editing them have infobox templates that have all of the parameters listed out on the page, including empty parameters. I like that when using the form to edit, it removes the parameters that don't have any value assigned to them. The only reason I had them all in each page to begin with was because I'm working with mediawiki illiterate members, hence adding forms for them to fill in information. So my question then is, I just managed to get an multiple instance template to work when it embeds in the main template but the form is adding the empty parameters of the embedded template. I would much prefer not to have the empty parameters.--Latinlives (talk) 23:13, 14 April 2014 (UTC)


 * I'll have to look into that - it sounds like a bug. Yaron Koren (talk) 14:38, 17 April 2014 (UTC)

Use Semantic Forms to Move Page
Not sure if this is currently possible, but figured it couldn't hurt to check if I was missing something. I want to be able to let users move a page like "Texas\San Antonio\Restaurant" to a different page like "Texas\San Antonio\Cafe" or "Texas\Austin\Restaurant", but using drop downs or autocompletes to select each subpage of the new url. Any ideas on how I could do this? Thanks


 * No, there's no way to do that. Yaron Koren (talk) 01:09, 22 April 2014 (UTC)


 * Well I ended up creating an extension that is a simple parser extension to move pages. Works like #movepage:oldurl|newurl|reason.  Not sure if it's worth submitting to MediaWiki, but I would if others want it.  Nevertheless it lets me use nice pretty Semantic Forms drop downs and text fields to move pages around.  Couldn't be easier for the user, and keeps the page structure tidy.  I'm continually amazed at the things that can be pulled off with this extension and Semantic Mediawiki.  Thanks again Yaron!

mandatory is ignored for input type=category
Hello,

I'm using mediawiki 1.21.2 and SemanticForms 2.7.

If I have the input type category the mandatory attribute is ignored. I've found out that this bug was already known in 2009 and should be fixed. Is it back again?

Thanks for your help! --Finswimmer (talk) 13:35, 24 April 2014 (UTC)


 * That sounds like a bug... although the "category" input type has actually been deprecated, in favor of "tree". Maybe switching to "tree" will fix the problem? Yaron Koren (talk) 22:05, 24 April 2014 (UTC)


 * Thank you for this tip. I've changed it to "tree", but the mandatory attribute is still ignored :( --Finswimmer (talk) 06:42, 25 April 2014 (UTC)

Alternative icons for radiobuttons - for a checklist. Any suggestions of how to achieve this?
​I'd be grateful of any advice on how to achieve this. It's not clear to me if it's easy or difficult, so I'd like to know what approaches are possible.

Currently I have this as the radio buttons for a checklist:

Ideally, what I'd like would be more like this:

Any suggestions?

Fustbariclation (talk)


 * You might get some traction using the autoedit link. It'd be kind of clunky with page reloads, but you might be able to set it as the target for an image link (never tried before). - Lbillett (talk) 16:29, 25 April 2014 (UTC)


 * That's an interesting question. The #autoedit option is clever but it won't work within a form - only outside it. I think you can do it, though, by uploading some custom images (which you pretty much already have) and adding some custom CSS to the page MediaWiki:Common.css. I found one tutorial on customizing radio button inputs via CSS here. I'm curious if this can actually work... Yaron Koren (talk) 16:49, 25 April 2014 (UTC)


 * It looks as if it is what I'm looking for - but I'm not clear about how to mix the CSS with the mediawiki form. If the CSS defines an input box, I don't see how to link that to the input box of the semantic form. I can see that, if you want the text of the form to be green, then, in the form you'd put SMW form definition - that's easy. If I have:


 * "The first question"

The 'input type-radiobutton' specifies the input. If you use CSS with HTML 5 you have

 Male

I don't see how to use the second inside the first. Fustbariclation (talk) 20:32, 7 May 2014 (UTC)


 * That's a tricky one; I hadn't thought about it fully. SF does assign each radiobutton input an ID (it'll look like "input_...", so you should be able to use that in the CSS page. You'll unfortunately have to change the IDs if you change around the structure of the form, but hopefully this can be made to work. Yaron Koren (talk) 00:56, 8 May 2014 (UTC)


 * Thank you, Yaron, I think you've given me the clue I need. I hadn't quite grokked the reason for giving html tag names when setting up templates and forms - this clearly is it! So I'll try linking those HTML IDs to the CSS IDs and see if that does the trick.

Fustbariclation (talk)

Ampersand in Values from
I'm trying to use "values from category=widgets & bobbles", but the ampersand seems to break this. Is there any way around this? I've tried &amp;amp;, %26, and #38; to no use. Appreciate any help on this. :)


 * What version of Semantic Forms are you using? Yaron Koren (talk) 16:40, 28 April 2014 (UTC)


 * Hey Yaron! I'm on 2.7.  Works fine if I use a category without an ampersand, but not if there's one in it.
 * Also, different issue, but how/can you use field properties in a values from? I'm trying to do something like "values from category= widgets"?  Thanks!


 * Okay, that sounds like a bug. For the second question, is the idea that the possible values are set dynamically, based on what the user has entered in fields called "City" and "State"? For that, you may need to use "values dependent on" - though it only lets you set the value based on one field, so you might need to change the data structure somewhat if you were going to use that. Yaron Koren (talk) 20:39, 30 April 2014 (UTC)


 * Ah, kind of figured on both counts. Started panicking about how I was going to get this thing to work, but managed to find a work around for both issues by using SemanticFormsSelect extension.  Lucky it just happened to turn up in a search result!  Thanks again Yaron.

Empty fields have their template arguments saved on article creation
Hello! (MW 1.21.2/SMW 1.9a3/SF 2.7) Since upgrading from SF 2.5.1 to 2.7, it seems now that when using a form to create an article, any empty form fields get their argument names saved to the article with an empty value. However, editing with a form does not do this. ('show on select' types still get empty argument names saved). Is this expected behavior? Where might I start looking to adjust this? Thanks! - Lbillett (talk) 19:32, 30 April 2014 (UTC)


 * Sorry, I don't understand - what's an argument name? Yaron Koren (talk) 20:29, 30 April 2014 (UTC)


 * My bad. The template written to the article contains all the field names (what I was calling argument names) even if the field was blank. So if the form has, say, 30 optional fields, but only a couple of them are filled out, the template call is quite long!


 * Functionally it's no problem. Just stores a lot of unused stuff. - Lbillett (talk) 21:21, 30 April 2014 (UTC)


 * Ah, yes, that's a bug. I don't know where it can be fixed - presumably in SF_FormPrinter.php. Yaron Koren (talk) 23:08, 30 April 2014 (UTC)

Query String Broken?
When you use "query string=template-name[field-name]=field-value" on a forminput, it's not passed into the form. Everything looks fine in the URL, the field is just blank. I know I had this working fine before, but I haven't checked in a while, and noticed it's broken now. Not sure if it got messed up in an update, or if it's just me?


 * Is this happening on a public wiki? If not, can you tell me what version of SF you're using, and the query string that shows up in the URL? Sometimes it's a problem of an incorrect capitalization, or an underscore instead of a space, etc. Yaron Koren (talk) 12:56, 16 May 2014 (UTC)


 * Well I suppose I fixed the problem. I'm running (Version 2.7)(8ab4f7a), so I downloaded the newest file and did a file compare, and saw there were differences in SF_FormPrinter and SF_Utils.  I swapped those files out with the new one, and now it's working again.  I'm not sure if the (8ab4f7a) means it was an older version, or if it was bug fix changes.  Thanks.


 * Okay, great. I do hope to release another SF version at some point soon. Yaron Koren (talk) 16:35, 16 May 2014 (UTC)

Problem with partial form editing multiple-instance templates
I am trying to upgrade a rather complicated SMW wiki. I have managed to get everything else working in the new setup, except for partial forms editing multiple-instance templates. They display nicely and you can add and remove templates and change their order the way it's meant to be, but when you save the form, none of the changes made are applied to the page. No error message (with "error_reporting( -1 );" and "ini_set( 'display_errors', 1 );" set) is given and everything seems to be working ok, but when the page loads after the form edit, it haven't changed at all. There is no new version in the page's history. The amount of templates doesn't affect this.

However, if you remove the "partial form" from the form's definition, it works exactly as it should. I'm kind of stuck here, and really don't know what to do or how to debug. My new setup is running MW 1.22.5, SMW 1.8.0.5 (I'm doing the smwsqlstore2 -> smwsqlstore3 migration in due time) and SF 2.7. My PHP is 5.4.4-14 and MySQL	5.5.35-0. I have no error messages and everything else works great. Can anyone help me? I really need this working. Molindho (talk) 06:28, 22 May 2014 (UTC)


 * Partial forms are a feature I'm no longer really supporting, and I actually hope to remove them from SF at some point. My recommendation is to replace any partial form with a "pseudo-partial form" - a form that includes all the templates of the main form for the page, but that only has fields for the one template that that form is supposed to edit - every other template would just have the code "  ". Would that work for you? Yaron Koren (talk) 21:43, 21 May 2014 (UTC)


 * Ok. It actually works almost exactly the way I had it working with older versions when you just eliminate the partial forms definition. The old partial forms didn't have a free text field, so I guess all the other templates are anyway regarded as free text and hang along, even if they don't show on the form. My page has a main single template and a number of different multiple-instance templates that store data on different types of environmental observations related to lakes (ie. water temperature, algal blooms, water transparency ..). The idea is for users to edit those multiple-instance templates one observation type at a time. The order of the multiple-instance templates in the page is not relevant, since they just store data that is queried in the main template. I originally used partial forms, since that is what I'm doing: editing parts of the page. But I can obviously make it work by just eliminating the partial form definition or by including all the templates in each form for different type of multiple-instance template (observations). The definition "partial forms" doesn't seem to work though, which is good for everyone to know. And thanks a lot for your quick answer. Molindho (talk) 06:28, 22 May 2014 (UTC)

#formlink print template at top of the page
I need that the form template is printed at the bottom to the page instead at the top... how can i do that?