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?


 * Put the "free text" input at the top of the form definition. Yaron Koren (talk) 20:43, 23 May 2014 (UTC)

Query string
Can you give me an example of how can i use the "query string" parameter in a #formlink parser function?

thaks for the previous answer: "Put the "free text" input at the top of the form definition" i'll try that


 * You can see one example here. Yaron Koren (talk) 21:58, 27 May 2014 (UTC)

Preventig formedit for a specific page in a category using a form
I am sure that this has been asked before, but somehow I have overlooked the solution in the documentation. Is there a way to specifically exclude a single page from being editable with a form even though the respective category requires editing with a specific form? E.g. I have a category "Plants" collecting plants but I also have a main page on plants called "Plants" in the same category containing the query for all plants added to a wiki as well as some text about plants in general. Editing this page with a form does not make sense and this is why it will be nice to remove formedit from this page. Cheers --&#91;&#91;kgh&#93;&#93; (talk) 14:59, 27 May 2014 (UTC)


 * You should have the template, instead of the category, specify the form, by using "Page has default form" instead of the standard "Has default form". Although maybe the better solution is to not have the "Plants" page in the "Plants" category... after all, it'll mess up the query as well. Yaron Koren (talk) 21:59, 27 May 2014 (UTC)


 * Ah, yes - sure, this is the way to do it! Probably I should have figured this out myself, so thank you for the (re-)vaccination. :) I think this is purely a Wikipedia style approach to organise the article providing a general overview in the same category as the related pages. Hmm ..., Cheers --&#91;&#91;kgh&#93;&#93; (talk) 08:17, 28 May 2014 (UTC)

Restricting #autoedit Buttons
I have several autoedit button that I need to restrict. I tried adding the normal |restricted=GroupName but that did not work. Is this possible? Thanks.

--Clifford.kasper (talk) 13:29, 28 May 2014 (UTC)


 * Unfortunately, there's no way to directly restrict #autoedit. However, there's another solution that's potentially better anyway, which is to hide the buttons from users who are not in the right groups, using the #ifsysop or #ifingroup functions from the UserFunctions extension. Yaron Koren (talk) 22:59, 30 May 2014 (UTC)


 * To add to the above: there's also the parser from Extension:SimpleSecurity (which comes bundled with MediaWiki). I'm using it for much the same purpose. Cavila (MW 1.22, MySQL 5.5.37-0, Php 5.4.4-14 squeeze, SMW 1.9.2, SF 2.7) 07:21, 2 June 2014 (UTC)


 * Extension:SimpleSecurity seems unstable and unmaintained. In what way is it bundled with MediaWiki? Perhaps better to use the UserFunctions extension. --84.105.211.99 08:59, 6 June 2014 (UTC)

Autosave
Is there any way to make this work with the Drafts extension, or implement another kind of autosave?


 * I don't know if there's a way to get forms to automatically save to a "Draft" namespace. Other than that, there's the "save and continue" button, though it's not automatic. Yaron Koren (talk) 01:56, 30 May 2014 (UTC)


 * I dont necessarily need them to save to a Drafts namespace, the main namespace would be fine. I have this functionality when not using forms, and while not a dealbreaker it would be nice to have an automatic save every x number of seconds. Thanks

Editing an already existing template
Hello. So, I am working on a wiki right now with semantic forms. Originally, I create forms to create all the pages. Now, we have a bot that will upload the data to the wiki with a specific template so that users won't have to create anything.

I thought that I would be able to create a form with the exact same parameters and the exact same template and it would be able to just take the values already on the template and fill the inputs. That however, has not been the case.

Have I gone wrong somewhere? Is it not as simple as having the exact same information? Is there a way in which I can trick the semantic forms into thinking that it was used to create these auto generated pages?


 * Are you talking about having an "edit with form" tab show up? If so, see here. Yaron Koren (talk) 14:31, 2 June 2014 (UTC)


 * No, I have the "Edit with Form" button. I have a page that has be generated with a python script. The page is empty other than the "Entity" template. I created a form using the same template with the same properties and inputs. I just wanted to know if it's possible to make the form read the template already on the page and take the information from that. Right now, it just takes the template already on the page and puts it into the "Free text" section, leaving all the inputs empty.


 * Are you sure it's the exact same template name in both the pages and the form? The data should really show up in the form, if that were the case. Yaron Koren (talk) 15:29, 2 June 2014 (UTC)


 * Here is a page generated with the python script: http://creawiki.net/index.php?title=Harvester ; here is the template: http://creawiki.net/index.php?title=Template:Entity ; here is the form using the exact same template (of course, a few irrelevant frields being removed) http://creawiki.net/index.php?title=Form:Entity ; Despite using the same template, it tells me that the page already exists and it doesn't use that form... am I doing something wrong? I just want the form to be able to edit what's already there, not rebuild it.


 * Great skin! I don't see what the issue is, though - everything seems to work correctly at the "edit with form" page. Yaron Koren (talk) 19:42, 3 June 2014 (UTC)

Count of a property multiple times in a page
Hi All

I'm looking at transferring data preiously stored in excel to FreightWiki. Users enter simple data each day, like the table below

I want to ensure before making a form that I can capture the information afterwards. I need to be able to count how many times the user said Yes or No in the Correct field, and easily view which dates they said yes and no to.

Eg - how many times in May was it a No? and then for what dates?

If the same property is used many times on one page - can you count it? and request the field beside it to be displayed?

Apologies if my question is not clear - I'm still learning!


 * I assume the idea is that all the data would go on one page, via multiple-instance templates? If so, you should store the data via either subobjects or Semantic Internal Objects - essentially the same thing, on the back-end. Yaron Koren (talk) 00:21, 5 June 2014 (UTC)

The image is not shown after uploading
Hi everybody, when i add in my form a attribute Page and add this to my form with the parameter uploadable. I can upload a File, but after saving the form, i want that the File or image is shown in created table. At the moment i get a link(http:...../index.php?title=Ab.txt&action=edit&redlink=1) to a nonexsiting page.. I'm sure this is a stupid problem, but i couldn't found a solution yet. Thx alot for your inputs!


 * Your template probably something like " Has image:: ". It should instead have something like " [[Image:]] ". Yaron Koren (talk) 18:35, 5 June 2014 (UTC)

I tried it with diffrent combinations of your template code(and of many other sites), but it still didn't work :( You can see the basic code on Formt and Template, maybe you can take a look at it and say what it needs futhermore to work.


 * I undid your last change to the template, and now it seems to work fine, here. By the way, testing is better done at scratchpad.referata.com than at www.referata.com. Yaron Koren (talk) 20:17, 10 June 2014 (UTC)

Autoedit also adds other values - bug or feature?
Hi, it seems that when an autoedit is done on one field also a value is added for a boolean field that has been added in the form and for which the page doesn't have a value. Why is this and should it be considered a bug? I would expect that only the things in the autoedit statement should be changed. --AdSvS (talk) 09:07, 6 June 2014 (UTC)

How to allow user to enter multiple values of a property
Hello,

I know SF has a great feature of "Allow for multiple (or zero) instances of this template in the created page". At runtime, a "Add Another" is there...

But what we need is something more simple: Allowing multiple instance of a property, e.g A Student has 0 or multiple phone numbers ( phone number is just a normal property, not class or template). I know that there is arraymap and delimiter but it is not very friendly to users...I would like to have the "Add Another" button instead...

I don't know if it is possible with SF. I would really appreciate if you could give me some hints.

Thank you


 * You would have to create a new multiple-instance template, holding just that field. The next version of Semantic Forms, by the way, will offer "tokenization" of a list of values - see "Multi-Value Select Boxes" here, for example - which may or may not be good enough for your needs. Yaron Koren (talk) 12:32, 8 June 2014 (UTC)