Extension talk:Page Forms

Show preview button doesn't work
The preview button does work in MW 1.15.3!

After upgrading to MediaWiki 1.16.1 "Show preview" button stopped working in all of the forms, it still works in other pages suck as discussion and other pages that don't have nothing to do with SF.

I am running MW 1.16.1, Semantic Forms (Version 2.0.9) and Semantic MediaWiki (Version 1.5.5)

I don't know if it is relevant but I will mention it anyways, I don't use Properties in my updated MW, just saying maybe somehow Properties are helping to Preview the page.


 * There was a recent change to the script, try replacing extensions/SemanticForms/libs/SF_ajax_form_preview.js by the latest dev version. (Remember to make a backup copy of the original file.) --F.trott 10:04, 3 February 2011 (UTC)


 * Unfortunately it still doesn't work! I do have $wgUseAjax = true; in my LocalSettings and no I don't have my wiki online! I know other people have the same problem, so it is not just me!


 * What exactly happens when you hit the Preview button? Is there any reaction? Javascript errors (Under Firefox see the error console)? Are other people's wikis online, by any chance?


 * Found the problem one of mine extensions were intervening with the SF.

Copying a form result into an another on submission
I saw that there is often some recurring demands for a nested form feature that would allow to edit a template with a form, and populate some of this template fields with "list of templates" that would also have their forms and would be set on a "multiple" setting.

An example of situation where it would be used was posted earlier in the discussions, here

I made a few modifications that allow to use the "multiple" form parameter with a new "replace" parameter. When the form is submitted, the contents of this multiple templates (a series of ... string ) is copied into the template used by the main form instead of having these contents hanging outside of the main template. That way, the user can keep a main template without having to split it into many parts (which would made layout modifications difficult).

Note that the current modification doesn't allow to really have nested forms into the main form. Unfortunately, the other forms will still have to appear outside of the main form, but at least the content will be copied into the corresponding template field, and when this template is edited this field's contents will be taken out of the main form and put as multiple form. Being able to have a real nested form would only require to do a few additional changes in the printing method on top of these modifications.

With all respects to Yaron for this great extension, the code in the formHTML function could benefit from some refactoring, 1000 lines in one single function makes it hard to decipher, even with the comments.

To use, in the form add a hidden field mapped to the template field to populate and declare a replace parameter. After the main form, add a multiple form, having a replace parameter equal to the one declared in the main form.

...

...

The changes are in extensions/SemanticForms/includes/SF_FormPrinter.php, function formHTML. I have put a zip here with the modified SF_FormPrinter.php (version 2.0.9), and a txt file describing a test set(each ****** delimiter indicates a new page to make). The parts modified are marker with //addition and //removal comments (9 areas modified)

--MgLy 08:09, 5 February 2011 (UTC)


 * Hi - this looks very interesting. It's true that the formHTML function is way too large - it's the part of the extension most in need of refactoring, though I'm a little afraid to touch it. :( I'd like to ask you some questions about this code - could you email me so we can start a discussion, or find me on the #semantic-mediawiki IRC channel? Yaron Koren 01:56, 8 February 2011 (UTC)

Making Map Input Required
The code below doesn't seem to force the user to enter in coordinates. Is this a bug? Am I doing wrong? Link to Actual Form Timothy Clemans 22:44, 6 February 2011 (UTC)


 * That sounds like an issue with the Semantic Maps extension - I would ask there. Yaron Koren 15:34, 7 February 2011 (UTC)

Embedded "ask" possible
Hi

I am very happy with SF. I would like to do a little trick, but for now am an not successful. I want do embedd a query but I need to substitute a varaible. What I have tried is this template:

Bearbeite diese Seite, um den Vorlagentext zu sehen.

Is this possible with some little hack? Thanks Chris --178.82.196.210 11:41, 7 February 2011 (UTC)


 * You could just use the variable, instead of hardcoding the name... Yaron Koren 15:36, 7 February 2011 (UTC)


 * Oh, yes this works! Thx! Chris--178.82.196.210 16:51, 7 February 2011 (UTC)

How to deploy SF?
I have 3 media wikis: prod, test and dev. Now I have made a data model in dev and want to deploy the whole thing into test. How do you recommend to do this? Using Special:Export seems not the best way to me because you only can filter the export by category. And using export entry namespace extension seems to have the problem with the "Category" namespace. This is because I want to export semantic categories but not the whole bunch.

Thanks Chris --178.82.196.210 12:53, 7 February 2011 (UTC)


 * This doesn't sound like a Semantic Forms question, but in any case, if you're just talking about the pages for the "data model", it's probably not that many, so you could just manually enter their names into Special:Export. Yaron Koren 15:38, 7 February 2011 (UTC)


 * Hmm ... in fact there are enough pages ... but you are right, I can manually export them. It would be neat if someone could do "export semantic form: xyz" and a "program" is taking care of categories, templates, attributes and forms. Thx, Chris--178.82.196.210 16:55, 7 February 2011 (UTC)
 * When I've had to do this in the past I've tagged each template, form and category (and sometimes main namespace articles that contain queries and business logic) with a category. That then allows me to quickly dump the data model and business logic to an XML file and load it into another wiki. If the category causes problems on some pages, you can tag all the pages with an empty template, and just add the category to that template for the export, and remove it afterwards.  - Borofkin 00:51, 8 February 2011 (UTC)
 * Thats a good idea Borofkin, thanks for the tip! Chris--85.124.73.210 09:41, 8 February 2011 (UTC)

Why do "Text"-Fields get brackets when I use wiki words/tags
I have a simple attribute of type text: But when I enter into the testfiled something like "lala foo ..." the result page is showing Tätigkeiten EN lala foo ..., where foo is a clickable wiki word.

Thanks Chris --85.124.73.210 14:10, 8 February 2011 (UTC)


 * Hi - I bet this is the issue. Yaron Koren 18:16, 8 February 2011 (UTC)


 * Hi, yes sounds in fact like this. "lead to PHP crashes (!) when very long texts are used as values.", would just be cool to know how long "very long" is :-) But I think I can test this out :-) ... tomorrow ...


 * I have setted this to true but its still like before. I cleared browser caches and did a modification on the property .... no luck ...


 * Did you set it to true below the inclusion of SMW? Yaron Koren 19:04, 9 February 2011 (UTC)

populate field from #forminput
Is there a way to populate a field within a form with what is entered in the #forminput text field? --Dgennaro 19:48, 9 February 2011 (UTC)


 * I do not think so. Maybe you could use the one-step process? --F.trott 20:28, 9 February 2011 (UTC)