Extension talk:Page Forms

CreateTemplate - Database Error
I tried the suggestions from previous discussion pages to know avail....so here is my problem:

I am getting the following error when I try to http://xxx/adx/Special:CreateTemplate:

Database error

A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was: (SQL query hidden)

from within function "SMW::getUnusedPropertiesSpecial". MySQL returned error "1044: Access denied for user 'zoneuser'@'localhost' to database 'zonedb' (localhost)".

I was getting the error with 1.8.2 and with 1.8.3 of Semantic Forms extension.

I am running on a windows box with
 * MySQL version: 5.0.51b-community-nt-log
 * PHP version: 5.2.5
 * MediaWiki version: 1.14.0
 * Semantic MediaWiki version: SMW 1.4.3

For debugging purposes, I have granted “zoneuser” all database privileges to the “zonedb” database and I still get the error.

Any pointers??--Bandee90 17:40, 17 September 2009 (UTC)


 * This has been fixed offline; a 'create temporary tables' permission was missing. Yaron Koren 20:51, 17 September 2009 (UTC)

input type=category/categories don't work with the mandatory attribute
Hi everyone. For some reason the attribute "input type=category/categories" doesn't become mandatory even though I label it with the mandatory label: What am I doing wrong?

--Gregra (UTC) 20:55, 4 August 2009 (UTC)


 * You've uncovered a bug in Semantic Forms; it'll be fixed in the next version. Yaron Koren 16:07, 6 August 2009 (UTC)
 * thanks Yaron, looking forward for the next version.--Gregra 12:38, 14 August 2009 (UTC)


 * Hi, it was already released, two days ago. Yaron Koren 12:52, 14 August 2009 (UTC)


 * Thanks, your extension is very useful for us!--Gregra 21:11, 2 September 2009 (UTC)

CSS For Forms (Changing the Style of Your Forms)
Hello. First I would like to say I really like your extension, great job. Ok, I wanted to apply different custom CSS for some forms I create. I was looking through some of the files, but am finding it difficult to find where the actual html code with any classes (for style) etc is being generated. Big picture: I would like to be able to query the name of the form called for and according to which name (form), apply a custom CSS file. Any ideas or files I should look at?

Thanks so much. -Felix. 8/4/09


 * Hi, thanks. Unfortunately, what you want to do is impossible. Instead, you should use different CSS classes for each form, then define them all in one location (I'd recommend the "MediaWiki:Common.css" wiki page). If all you want to change is the look of the table in each, you can just substitute the class "formtable" in the default form with a different name for each form, then proceed that way. Yaron Koren 16:12, 6 August 2009 (UTC)


 * Thanks so much for the reply. I will take a look at your idea right now. Also, I found out that what the code does is simply create a template which is inserted every time you create a new form. So what seems to work is create my forms, then edit the template page that is generated (adding styles there) and every page where the 'form'/'table' is transposed changes automatically. No CSS files needed, well, I'm doing in-line style insertions on each template. Thanks! -Felix 8/5/09


 * Just an update. Yaron, thanks so much what you suggested, perfectly matches what I needed along with what I had found out. So basically:

Solution: Changing the Style of your Forms
 * 1) Create Your Forms
 * 2) *This creates a template which you can navigate to by going to .../Template:
 * 3) *Please Note: The Template is a table, ie. What is being transcluded is a table, so table rules apply
 * 4) Change the Look one of two ways:
 * 5) Edit the Template page
 * 6) *After navigating to the Template page, edit the page and add any div's or in line style css to change the appearance of your forms.
 * 7) *Make sure you pay attention to the 'include' and 'noinclude' tags
 * 8) Edit the CSS
 * 9) *Navigate to the .../Mediawiki:Common.css page
 * 10) **Now add your custom css to the page
 * 11) *Now go to your form's template page and change its class to the one you created.

Hope this helps everyone. -Felix (NSotres)8/5/09

Preload data into multiple-instance templates?
Is there a way to preload data into multiple-instance templates via the URL query string?

When I try setting it as would set the single-instance templates (i.e. templatename[fieldname]=value) I always get

Warning: array_key_exists [function.array-key-exists]: The second argument should be either an array or an object in C:\xampp\htdocs\w\extensions\SemanticForms\includes\SF_FormPrinter.inc on line 574 --F.trott 07:15, 6 August 2009 (UTC)


 * That looks like a bug in SF; I'll look into it. Yaron Koren 17:11, 6 August 2009 (UTC)


 * Somewhat fixed in version 1.8.2, I believe - unfortunately, you still can't set a preload value for a field within a multiple-instance template (I don't know if this was ever possible), but at least it doesn't give an error message. Yaron Koren 15:57, 12 August 2009 (UTC)

Not installing namespaces
I'm not getting any errors, but my Special:AllPages does not show any of the new namespaces that should exist (like Property). When I use the Special:CreateProperty page for example, it just adds the property as a root page off the standard namespace.

Any idea what could cause this? I notice that it doesn't have any namespaces that are not listed in my LocalSettings.php $smwgNamespaceIndex = 115; include_once("$IP/extensions/SemanticMediaWiki/includes/SMW_Settings.php"); enableSemantics('telarapedia.com'); include_once('extensions/SemanticForms/includes/SF_Settings.php'); $wgExtraNamespaces = array( 	100 => 'Portal',	110 => 'NameSpace2',	111 => 'NameSpace3', ); Hope someone can figure out what is happening. :) MW 1.15.1
 * 1) updates below:


 * My guess is that it's due to your namespace-rearranging; it might be that you can fix it just by putting the $smwgNamespaceIndex line after the SMW include. Yaron Koren 17:19, 6 August 2009 (UTC)


 * I did end up fixing it after re-arranging my namespace, so thank you for that suggestion. I didn't do what you suggested, but what I did was remove that array, and then add each namespace on its own line...although I don't see why that should have mattered.  I'll try the Index one on another wiki. :)

--Ciovala 21:47, 7 August 2009 (UTC)

Setting field to pagename in template (property question)
I did some searching, and the recommendation was to set it to in the template. However, if you do this, don't you then lose the property feature? For example, let's say I had a property setup of type page. This is nice when I setup a form and field to refer to the property. How can I still use a property type when I'm resorting to using { as opposed to a custom variable (which obviously I then have to just ask the user to type the name in exactly as it was on the initial form 'submit' page)?


 * Why not something like Has title:: ? Yaron Koren 14:53, 10 August 2009 (UTC)

autocompletion problem
Hi, I don’t know if the problem is a bug or not, but I have a problem with the kilo separator. Imagine a number, say 54785 (raw format). Autocompletion show us this number "54 785" and if you click on this value, the associated field contains "54&amp;nbsp;785". As a consequence, the Special:RunQuery doesn’t found a match.

I run a French Médiawiki. To solve this problem, I changed "smw_kiloseparator" => "&amp;nbsp;" to "smw_kiloseparator" => "" in languages\SMW_Messages.php.

--LeLorrain 11:40, 10 August 2009 (UTC)

Italian translation almost completed
This is the italian translation used for my wiki http://web.rif2009.org/mediawiki. Thanks everybody! Maybe the translation is not perfect, but certainly it's better than the orginal one! :P /** Italian (Italiano) * @author Alessandro Rosà */ $messages['it'] = array(	'semanticforms-desc'                => 'Form per aggiungere e modificare dati semantici',	'specialpages-group-sf_group'        => 'Form semantici',	'createproperty'                     => 'Crea una proprietà',	'sf_createproperty_linktoform'       => 'Questa proprietà ti collegherà alla pagina che usa il seguente form:',	'sf_createproperty_allowedvalsinput' => 'Se vuoi che questa proprietà possa ammettere solo determinati valori, inserisci una lista di valori ammessi, separati da virgole (se un valore presenta una virgola, sostituiscilo con mettendoci un backslash davanti in questo modo "\,"):',	'sf_createproperty_propname' => 'Nome proprietà:',	'sf_createproperty_proptype' => 'Tipo:',	'templates'                          => 'Template',	'sf_templates_docu'                  => 'Il seguente template già esiste nel wiki.',	'sf_templates_definescat'            => 'Definisci categorie:', 'createtemplate'                    => 'Crea un nuovo template', 'sf_createtemplate_namelabel'       => 'Nome template:', 'sf_createtemplate_categorylabel'   => 'Categorie definite attraverso template (opzionale):', 'sf_createtemplate_templatefields'  => 'Campi template', 'sf_createtemplate_fieldsdesc'      => 'Per richiamare i campi di questo template non è necessario usare il loro nome, semplicemente inserisci il numero d\'\' indice del campo (per esempio 1, 2, 3, etc) al posto del nome.', 'sf_createtemplate_fieldname'       => 'Nome campo:', 'sf_createtemplate_displaylabel'    => 'Parola da mostrare:', 'sf_createtemplate_semanticproperty' => 'Proprietà semantiche:', 'sf_createtemplate_fieldislist'     => 'Questo campo può contenere una lista di valori, separati dalle virgole', 'sf_createtemplate_aggregation'     => 'Aggregazione', 'sf_createtemplate_aggregationdesc' => 'Per vedere, fra le pagine che usano questo template, tutte le pagine che hanno una proprietà che punta a questa pagina, specifica la appropriata proprietà qui sotto: ', 'sf_createtemplate_aggregationlabel' => 'Titolo per la lista:', 'sf_createtemplate_outputformat'    => 'Formato di output:', 'sf_createtemplate_standardformat'  => 'Predefinito', 'sf_createtemplate_infoboxformat'   => 'Infobox nella parte destra', 'sf_createtemplate_addfield'        => 'Aggiungi Campo', 'sf_createtemplate_deletefield' 	 => 'Cancella', 'sf_createtemplate_addtemplatebeforesave' => 'Devi aggiungere minimo un template a questo form prima di poterlo salvare.', 'forms'                             => 'Form', 'sf_forms_docu'                     => 'I seguenti form già esistono nel wiki.', 'createform'                        => 'Crea un nuovo form', 'sf_createform_nameinput'           => 'Nome form', 'sf_createform_nameinputdesc'       => '(la convenzione vuole che il nome del form venga assegnato dopo la popolazione del template principale ):', 'sf_createform_template'            => 'Template:', 'sf_createform_templatelabelinput'  => 'Nome da visualizzare del template (opzionale):', 'sf_createform_allowmultiple'       => 'Permetti multiple (nessuna) istanze di questo template nella pagina creata', 'sf_createform_field'               => 'Campo:', 'sf_createform_fieldprop'           => 'Questo campo definisce le proprietà  $1, di tipo $2.', 'sf_createform_fieldproplist'       => 'Questo campo definisce una lista di elementi che ha la proprietà $1, di tipo $2.', 'sf_createform_fieldpropunknowntype' => 'Questo campo definisce la proprietà $1, di tipo non specificato.', 'sf_createform_inputtype'           => 'Tipo input:', 'sf_createform_inputtypedefault'    => '(predefinito)', 'sf_createform_formlabel'           => 'Nome da visualizzare form:', 'sf_createform_hidden'              => 'Nascosto', 'sf_createform_restricted'          => 'Riservato (solo utenti di tipo sysop possono modificarlo)', 'sf_createform_mandatory'           => 'Obbligatorio', 'sf_createform_removetemplate'      => 'Rimuovi template', 'sf_createform_addtemplate'         => 'Aggiungi template:', 'sf_createform_beforetemplate'      => 'Template precedente:', 'sf_createform_atend'               => 'Alla fine:', 'sf_createform_add'                 => 'Aggiungi', 'sf_createform_choosefield'         => 'Scegli campo da aggiungere', 'createcategory'                    => 'Crea una categoria', 'sf_createcategory_name' 			 => 'Nome categoria:', 'sf_createcategory_defaultform'     => 'Form predefinito:', 'sf_createcategory_makesubcategory' => 'Falla diventare una sottocategoria di una categoria già presente (opzionale):', 'createclass'                       => 'Crea una classe', 'sf_createclass_docu'               => 'Aggiungi tutte le informazioni qui per creare le proprietà, template, form e le categoria per una singola classe. Per ulteriori opzioni invece vai alla pagina $1.', 'sf_createclass_allowedvalues'      => 'Valori permessi', 'sf_createclass_listofvalues'       => 'Lista di valori', 'sf_createclass_leavefieldblank'    => 'Se il nome del campo è lo stesso del nome della proprietà. non puoi lasciarli vuoti.', 'sf_createclass_missingvalues'      => 'Campi richiesti non completamente riempiti.', 'sf_createclass_success'            => 'Proprietà, template, form e categorie verranno create.', 'addpage'                           => 'Aggiungi pagina usando un form', 'sf_addpage_badform'                => 'Errore: nessun form è stato trovato alla pagina $1', 'sf_addpage_docu'                   => 'Inserisci il nome della pagina qui, per esser modificata con il form \'$1\'. Se questa pagina esiste già, verrai indirizzato ad un form che ti permette di modificarla. Altrimenti, verrai indirizzato ad un nuovo form che ti permetterà di aggiungere la nuova pagina.', 'sf_addpage_noform_docu'            => 'Inserisci il nome della pagina qui, e selezione il form con cui la vuoi modificare. Se questa pagina esiste già, verrai indirizzato ad un form che ti permette di modificarla. Altrimenti, verrai indirizzato ad un nuovo form che ti permetterà di aggiungere la nuova pagina.', 'addoreditdata'                     => 'Aggiungi o modifica', 'adddata'                           => 'Aggiungi dati', 'sf_adddata_title'                  => 'Aggiungi $1: $2', 'sf_adddata_badurl'                 => 'Questa è la pagina per modificare i dati inseriti. Devi specificare per entrambi il nome del form e indirizzo della pagina nello spazio dell \'\ URL; dovrebbe risultare una cosa di questo tipo \'Special:AddData?form=&lt;form name&gt;&target=&lt;target page&gt;\', oppure \'Special:AddData/&lt;form name&gt;/&lt;target page&gt;\'.', 'sf_adddata_altforms'               => 'Invece puoi aggiungere una pagina con uno dei seguenti form già creati:', 'sf_adddata_altformsonly'           => 'Per favore seleziona una dei seguenti form per aggiungere questa pagina:', 'editdata'                          => 'Modifica dati', 'sf_formedit'                       => 'Modifica con un form', 'sf_formcreate'                     => 'Crea con un form', 'sf_viewform'                       => 'Visualizza form', 'sf_editsource'                     => 'Modifica sorgente', 'sf_editdata_title'                 => 'Modifica $1: $2', 'sf_editdata_badurl'                => 'Questa è la pagina per modificare i dati inseriti. Devi specificare per entrambi il nome del form e indirizzo della pagina nello spazio dell \'\ URL; dovrebbe risultare una cosa di questo tipo \'Special:EditData?form=&lt;form name&gt;&target=&lt;target page&gt;\', oppure \'Special:EditData/&lt;form name&gt;/&lt;target page&gt;\'.', 'sf_editdata_morethanoneform'       => "Attenzione: Più di un form predefinito è stato definito per questa pagina.", 'sf_editdata_formwarning'           => '\'\'\'Attenzione:\'\'\' Questa pagina esiste già, ma non usa questo form.', 'sf_editdata_remove'                => 'Rimuovi', 'sf_editdata_addanother'            => 'Aggiungi un\'\altro', 'sf_editdata_none'                  => 'Nessuno', 'runquery'                          => 'Esegui query', 'sf_runquery_badurl'                => 'Devi specificare il nome del form nell\'\ URL; l\'\ URL dovrebbe risultare una cosa di questo tipo \'Special:RunQuery/&lt;form name&gt;\'.', 'sf_runquery_title'                 => 'Esegui query: $1', 'sf_runquery_additionalquery'       => 'Query aggiuntive',

'sf_formerrors_header'              => 'Ci sono stati degli errori nel form di input; vedi qui sotto', 'sf_blank_error'                    => 'Non può esser vuoto', 'sf_bad_url_error'                  => 'Deve avere un formato dell\'\URL corretto, completo anche di \'http\'', 'sf_bad_email_error'                => 'Deve avere un formato per di indirizzo email valido', 'sf_bad_number_error'               => 'Dev\'\esser un numero valido', 'sf_bad_integer_error'              => 'Dev\'\esser un\'\intero valido', 'sf_bad_date_error'                 => 'Dev\'\esser una data valida', 'uploadwindow'                      => 'Finestra di upload',

// content messages 'sf_property_isproperty'            => 'Questa è una proprietà di tipo $1.', 'sf_property_linkstoform'           => 'Ti collegherà alle pagine che usano il form $1.', 'sf_property_allowedvals'           => 'NaN I valori permessi per questa proprietà sonos:', 'sf_template_docu'                  => 'Questo è il template \'$1\'. Dovrebbe esser chiamato con il seguente formato:', 'sf_template_docufooter'            => 'Modificare la pagine per vedere il testo del template.', 'sf_form_docu'                      => 'Questè è il form \'$1\'. Per aggiungere una pagina con questo form, inserire il nome della pagina qui sotto; se la pagina con il nome indicato è già esistente, verrai inviato al form di modifica della pagina.', 'sf_form_freetextlabel'         => 'Testo libero', 'sf_category_hasdefaultform'        => 'Questa categoria usa il form $1.', 'sf_category_desc'                  => 'Questa è la categoria $1.', 'sf_blank_namespace'                => 'Principale', );


 * This is great, thanks a lot. For future additions and changes to this, please use http://translatewiki.net, if possible. Yaron Koren 13:18, 12 August 2009 (UTC)
 * Oops! Sorry. Next time i'll do it! --Elciopa 12:39, 3 September 2009 (UTC)

Dummies guide to Semantic Forms
Is there a "Dummies guide to Semantic Forms" anywhere, e.g. a simple step-by-step 'howto' guide?

I am not a dummy but I cannot afford the time to get my head around how to make this thing work.

All I want to do is make a fairly template to make pages.

I am finding it is far too difficult to work out how to make it 'just work'.

Thanks ... --Nonegiven108 06:56, 13 August 2009 (UTC)


 * Did you see this? If not, that might help. Yaron Koren 15:40, 13 August 2009 (UTC)


 * I did see this, it well helps, but still I think what Nonegiven108 would like to have is some more examples to copy from. I also have some difficulties to find out where and how to use the various tags in forms etc. Thanks anyhow for this great extension and your help! Horst. Salzwedel (at) gmail.com --190.66.182.123 17:33, 21 August 2009 (UTC)

Improved Preview
I cooked up an improved preview functionality. It does not reload the whole page and - more importantly - the user is not pushed back to raw wikitext input (which is pretty much unacceptable round here :-) ) but keeps the form.

What do you have to do?
 * 1) Copy the javascript code to somewhere where it is executed, e.g. the MediaWiki:Common.js page of your wiki
 * 2) Include a   in your form, i.e. a preview button (doh)
 * 3) Include a    at the spot in your form where you want the preview to appear (Without this step you get the plain old preview, i.e. that is still available if you need it.)

Problems/Caveats:
 * relies on Javascript and Ajax
 * only tested with IE6, and not too deep either
 * obviously, semantic data that depends on the page being saved is not rendered correctly; but that's not different from the behaviour of the standard preview

You can find the source code at smw.referata.com/wiki/User:F.trott/ajaxFormPreview.js.

Thanks go to Alex Smotrov on Wikipedia for his  ajaxPreview.

--F.trott 10:28, 13 August 2009 (UTC)


 * UNBELIEVABLE!! It works! I set it up on the SMW Community Wiki, where you put the source code (anyone can try it out here); and it works in Firefox, too, which I assume means it's an all-purpose solution. I don't think the fact that it relies on Javascript and Ajax is a problem - forms already use Javascript quite a bit. This is really going to change a lot, I think. Thanks for coming up with this idea! Do you mind creating a "tip" for it on the wiki? If it's a problem, I can do that. Yaron Koren 15:23, 13 August 2009 (UTC)


 * Alas... I just looked at it again, and there's one problem: if you try out that form, the checkbox inputs always show up in the preview as if all of them are checked. Do you have any idea if that can be fixed? It seems like a rather minor detail to block this whole feature. Yaron Koren 04:09, 14 August 2009 (UTC)


 * Hmm, right now I just take any form element and send it on without any checks. I'll look into it next week. Another problem occurs if there is javascript in the previewed page (e.g. timelines, google maps, ...): It is just not executed. I don't have any idea right now how this can be handled. We might also have a css problem along these lines. As a fallback I think about sending some parameter (maybe named "preview") so the template would know that it is in preview mode and could deal with it (e.g. if the "preview" parameter is set just omit problematic stuff from the output). I could include that as a feature anyway. I'll write the tip (including some dire warnings :-) ) sometime next week, too. --F.trott 18:33, 14 August 2009 (UTC)


 * Alright. As far as the tip, it might not be necessary, since if those issues are resolved I'm thinking strongly of adding this Javascript directly into SF, and adding the corresponding HTML change into the SF documentation. Yaron Koren 18:59, 14 August 2009 (UTC)


 * Ok, the script checks now, if the element is a radiobutton or a checkbox and in these cases only sends the data if the box is checked. (Don't know, if that's the right thing to do, but it seemed to work, whereas sending "false" for unchecked boxes didn't, so...)


 * Javascript remains a problem. I had hoped to somehow trick an iframe into executing it. But I can't set the HTML text directly. Instead I could set a source URL. Alas I don't have one. Right now I don't see a solution to that one short of parsing the HTML and doing an eval on every piece of script. And I'm not sure that that would work.


 * The idea of sending a "Preview" parameter to each template does not work either. I had hoped, just adding the parameter to the POST data would trick the server-side script into adding it to the article text, but no luck there. I could use a pointer which PHP script needs to be adjusted and where. --F.trott 12:33, 18 August 2009 (UTC)

Okay, thanks, it looks like it works perfectly now. It still fails on Referata, but that's just because the old version of the JS is cached, which I don't know how to get rid of. No need for a "tip"; I'll add this Javascript directly into the next version of SF. Thanks again for this code; it should have a big impact. Yaron Koren 20:38, 18 August 2009 (UTC)


 * I made a last small correction: The value of submit buttons was sent when it should not. It works with the old code, too, but only because of the somwewhat peculiar way, the server prioritizes the sent parameters.


 * I also build a second version which invokes javascript contained in the previewed page. It sometimes works, sometimes not (E.g. timeline works in IE, but not in FF. Some timing problem, I believe.), but so far it did not break the page altogether. I think, the worst that could happen is that some elements are still not rendered correctly. If you want to give it a try you find it at smw.referata.com/wiki/User:F.trott/ajaxFormPreviewJS.js. --F.trott 09:49, 20 August 2009 (UTC)


 * Thanks for these improvements; they'll go into the next release, which I hope will happen in the next few weeks. Yaron Koren 16:50, 20 August 2009 (UTC)

Inserting Images
Hi, I just wanted to know if there was a way of inserting images into the form. ie, i want to be able to either fill in a string field or have a drop down menu allow me to select which picture to put in. So that once the page is created, it will display the picture I chose.

I know the template generates semantic code, but is there a way for it to take wikicode and have it be interpreted correctly?

Thanks.

Felix (8/14/09)


 * See the uploading files section. Yaron Koren
 * Hi, thanks yaron, I mustve just missed that.
 * Update: Actually, this functionality just uploads files into the wiki. It does not actually display a picture on the new/edited page by using the form.

-Perhaps I wasn't clear with what I wanted. I want to be able to select an image with a form and have the page I create/edit display that image I selected. Is this possible?


 * I see - you should use "autocomplete on namespace=File" or "...=Image" in the field declaration, depending on what the namespace is called in your version of MediaWiki. Yaron Koren 21:32, 14 August 2009 (UTC)


 * Hmmm.. not sure I follow, wouldn't that be the same as me putting in the wikicode for a picture inside of a string field? I am not sure if that actually works. Thanks for the idea. Ill look into it. Felix 8/17/09

What I've found out:

Assume you have a Template set up as follows: (where Name is a String field)


 * 1) What doesnt work
 * 2) Inserting your standard image wiki code
 * 3) * Name= [[Image:ExPicture.png]] (for example)
 * 4) ** This displays the image but it will also display the property field along with the image as such:
 * 5) *** Name::
 * 6) *** That is to say that you also see the text above along with your image ( is the actual displayed image)
 * 7) *** So you'll see the text "Name::",, and then the text "" displayed.
 * 8) What Semi-Works
 * 9) Adding some extra brackets
 * 10) * if you add a 'caption' (not really how its done) and some closing brackets:
 * 11) ** Name= My Image]][[Image:exPicture.png]]
 * 12) * Now you will NOT see the Property name, but your 'caption' instead as follows:
 * 13) ** My Image ]]
 * 14) *** ie, only the closing brackets show along with your 'caption' (text) and your image
 * 15) However, if you try something like:
 * 16) * Name= My Image]][[Image:exPicture.png]][[
 * 17) * Then the form is messed up.

If you still don't understand, try putting an image using wiki code inside of a form that accepts a String thanks.

Felix 8/18/09


 * Sorry, what? Why so many brackets? And why not make the image caption and image name be two separate template fields? Yaron Koren 18:11, 18 August 2009 (UTC)
 * Updated, hope it makes more sense now.. Felix


 * Hi - yes, semantic properties don't display images correctly. You should instead have something like " [[Image:]] ". Yaron Koren 20:25, 18 August 2009 (UTC)

New 'default' code - 'page' ?
Hi Yaron

I came across a potential feature today - I have to pre-set a text field in a form with the page name by default.

Since I was not able to pass to the  parameter (it shows as 'PAGENAME'), I thought a new default code would be useful in that situation, as in '|default=page'.

My example is in a glossary situation, where I want to assign the page name as a default value for properties such as 'Has preferred label'.

- Laurent


 * You could just have something in the form like "Preferred label (leave blank to use page name)", then an #ifeq call in the template. That way it would work even if the page were later moved. Yaron Koren 18:14, 18 August 2009 (UTC)


 * That would work. Thanks for the suggestion ! I didn't think about reversing the problem :) - Laurent

Multiple-instance Template Example
Hi:

I just wanted to let you know that I filled out the example form you link from the multiple-instance template paragraph and created a page by mistake:

I'm sorry about that. I realize now it's meant as an example and not a working form.

-Katie


 * That's alright. It's true that Discourse DB isn't really meant to be used for creating test pages, though hundreds of people have done it anyway, so it's no big deal. Yaron Koren 00:36, 19 August 2009 (UTC)

Date Time
Hello, I tried finding the answer in the archives, but didnt. I am using both latest versions of Mediawiki and Semantic Mediawiki. Does anybody else get an error when using a date field and setting it as 'date time' in the form?

In other words, when I build a form and set a date field to be 'date & time' as opposed to just date (default), when I add a page with this form and fill it out (drop downs and fill ins) the generated page does not show the date and time. It just shows the little warning sign and the message says that the date was not understood. More exactly, "" is not understood. So Im assuming it is not filling in the date & time.

Anybody else getting this?

thanks. -Felix


 * Does the source text of the page show the right value, or is the field blank there too? Yaron Koren 19:37, 19 August 2009 (UTC)

Set defaults dynamically
Now I know what fun you can have with Javascript, I took a stab at another problem: Presently you can set defaults for form fields to constant values only (with some exceptions, granted). I wrote a script, that lets you set defaults to any value, constant or generated.

I put it in a tip at smw.referata.com:

--F.trott 17:17, 22 August 2009 (UTC)

Can wiki syntax be used in a form field?
Can wiki syntax be used in a form field?

Example: [[Media:Example.doc|Example.doc]]

Presently I have a text property type attached to my "Example" form field. When wiki syntax is used in the form field the output appears as follows: Example.doc This is a document.]]

When it should appear:

[[Media:Example.doc|Example.doc]] This is a document.

-Dgennaro 18:49, 25 August 2009 (UTC)


 * It should be possible, to use wiki markup in the values for input types text and textarea. It is here, at least. IIRC there was something going on with using image or media links in properties. I don't know, if this applies here. Does some simpler markup work, e.g. bold text? --F.trott 11:03, 26 August 2009 (UTC)


 * Yes, bold text works. I think it might have something to do with the use of the | (pipe) within the links.
 * --Dgennaro 15:17, 26 August 2009 (UTC)


 * Just noticed in the section above, Inserting Images, that these issues are the same. I am currently using these "work arounds" now, but I am looking for a solution.
 * --Dgennaro 15:22, 26 August 2009 (UTC)

"values from category" also shows subcategories
I just realized that the following is a problem for me - cat a -- cat b (subcategory of cat a) -- cat c (subcategory of cat a) If I use "values from category=cat a" in my form it will also show all pages that are only set to "cat b" or "cat c"...

Is there something I can do about this?

--Fez 10:06, 27 August 2009 (UTC)


 * There is no simple solution I think. My approach would be to somehow use "values from concept". The problem is that while you can query for "pages in some category" . (Why not, though?) To overcome this you could define a property "is in category" and whereever you set an article to be of some category also set that property, e.g. write something like  . Then you could have a concept with


 * and use that in your form definition. --F.trott 13:37, 27 August 2009 (UTC)


 * Another possibility is to add all the pages directly in category "A" to a second category, maybe called "Only A". Though maybe the solution is to reconsider your categorization scheme - after all, if B is a subcategory of A, then that should imply that everything in B is really a member of A as well. Though that might be presumptuous of me. Yaron Koren 14:52, 27 August 2009 (UTC)

Feature requests: has subpage form
Currently, a namespace page in the project namespace can specify a default form for any page in that namespace. However for namespaces that allow subpages, the information gathered for a 'base' page should usually NOT be gathered for subpages.

Suggestions:
 * has default page form::pageform
 * applies only to non-subpage pages


 * has default subpage form::pageform
 * applies only to subpage pages


 * has alternate page form::pageform
 * applies only to non-subpage pages


 * has alternate subpage form::pageform
 * applies only to subpage pages

Minor bug (or feature?): No parameters without value for hooked input types
SF Version 1.8.1

When defining an input type I try to define a parameter without value for a field, e.g. the parameter "enable baz" in

Expected: A key without value (i.e. null) in the $other_args array of my hooked in function

Observed: All parameters without value are left out.

Solution: Insert

else if (count($sub_components) == 1) $field_args[$sub_components[0]] = null;

at line 567 of SF_FormPrinter.inc

--F.trott 23:02, 29 August 2009 (UTC)

Feature request for #arraymap
Hi Yaron

How hard would it be to add a 'sort' parameter to #arraymap to force the display of values in the array in the ascending or descending alphabetical order ?

I get the request to sort multiple values in a field. I looked at extensions to do that but I did not find anything that would work so far (although I may give the simple 'sort' extension a shot).

I thought it would be a lot more simple and elegant if the sort function was part of the arraymap function already.

- Laurent Alquier


 * That seems outside the reasonable scope of the #arraymap function; I would look into using the #arraysort function from ArrayExtension instead. Yaron Koren 03:45, 2 September 2009 (UTC)


 * Thanks. I didn't know about that extension.

- Laurent

Minor Bug: Undefined variable: info_id in SF_FormInputs.inc on line 595
Still SF 1.8.1

If you have some mandatory radiobuttons with a default value set the info_id is not set and a notice thrown (with PHP and MediaWiki set to be fussy).

Solution: Move line 571 of SF_FormInputs.inc $info_id = "info_$sfgFieldNum"; behind the if-clause, e.g. to line 579. --F.trott 10:39, 31 August 2009 (UTC)

input type=category/categories radio button or select box on headers only
I believe I missed a step when trying use the Category and categories options.

I copied the wikitext from both the Template and Form from DiscourseDB. When I add a new page, the header rows are the only items with the Radio button (category) or a Select box (Categories.)

Actual Categories in the trees do not have selection items but are links

Mediawiki 1.13.2 // PHP 5.2.6 // MySQL 5.0.67

Any suggestions on what I missed?


 * Do you have the CategoryTree extension installed? Yaron Koren 03:49, 2 September 2009 (UTC)


 * I have CategoryTree (Version r37574) installed and Categorytree works on the articles in the wiki. The special functions for Semantic forms is not working utahstew 12:11, 3 September 2009

RunQuery and redirects
Hi, I love the enhancement RunQuery! Up to now I used it to query properties with data type string. Now I got the demand that I should recognize synonyms too. So I changed my property to data type page and made redirections. I get results if I query redirected pages with SMW Browser, but I don't get results if I query them with "RunQuery". My question: Supports RunQuery redirects? - --Ulli 757 22:04, 6 September 2009 (UTC)


 * Hi, thanks. But what's SMW Browser? Yaron Koren 03:08, 7 September 2009 (UTC)


 * Hi Yaron, thats meant for me "Semantic Search" (Special pages/Semantic Media Wiki) - don't know why I wrote SMW Browser. Redirects? - Do you know if they should work with RunQuery? - --Ulli 757 05:25, 7 September 2009 (UTC)


 * Well, all RunQuery does is display a template, which (presumably) includes an #ask query. What happens if you put that query in a separate page? Yaron Koren 15:23, 7 September 2009 (UTC)


 * Thank you!That was a good hint! In my template I use wildcards like this {{#ask:}}}* .I tried it in a separate page now and the result is: {{#ask:Symptom::~*macroglossia*}} works and {{#ask:Symptom::~*largetongue*}} works not. I have to correct myself - I thougt macroglossia was the original page and largetongue the redirected page, but fact is: largetongue was the original page. btw querying largetongue without wildcards works. So, it seems to be an unattractiveness from Semantic Media Wiki. I hope this is a solveable problem and to get a solution there,because I don't like to do my queries without wildcards. regards --Ulli 757 16:45, 7 September 2009 (UTC)

Edit a page with formlink
How to edit an existing page with the formlink


 * You can't do that. Yaron Koren 17:21, 8 September 2009 (UTC)
 * Thank you, sirisha

Entering not yet existing values
When using values from category like this:

is it possible that the user enters a value that does NOT YET occur in category:staff? Or is the right procedure that the user first adds the new author to the category:staff and then returns to the form? Thanks very much for your help! Thomas


 * Either that or you could use the "autocomplete on category" parameter. --F.trott 18:53, 11 September 2009 (UTC)

Thanks, that makes sense. For some reason autocomplete does not work or I dont understand how it works: when I type e.g. an 'A' in the respective field of the form I would expect the names of people in category staff that start with 'A' to show up somehow. But nothing happens and the obvious tab key just puts the cursor in the next field. Could it be that "autocomplete on category" requires an additional extension which "values from category" not needs? Thomas


 * Autocompletion needs access to the YUI library. So the server either needs an internet connection to get it directly from Yahoo or if that's not possible you have to install the library locally (see Extension:Semantic_Forms). --F.trott 18:37, 12 September 2009 (UTC)

Thanks very much for your quick reply and help. So, I downloaded the yui library, unzipped it and set the variable sfgYUIBase in LocalSettings.php. But still no autocompletion. Is there a way to debug this somehow? Using MediaWiki 1.15.0 and the latest Semantic Forms. Thomas 14 Sep 2009 (14:47)


 * Well, this would certainly be easier to debug if it were a public wiki... could you look at the HTML source of the form (not the form-definition page, but the form itself), and see if the autocompletion values that you're expecting are there anywhere? That will help determine if it's a PHP or Javascript problem. Also, what version of Semantic MediaWiki are you using? Yaron Koren 14:18, 14 September 2009 (UTC)

Yes, the autocompletion values are there. Does that mean it is a Javascript problem? I am using SF_VERSION 1.8.3. For debugging would you need write access to the wiki, because I think that it is readable: https://intra.ifsv.ku.dk/biostat_annualreport/index.php5/Form:Project. Your assistance is very much appreciated, thanks a lot! Thomas 14 Sep 2009 (17:07) (UTC).


 * Ah, great, that does make things much easier. By the way, this is a note for everyone: if your wiki is publicly viewable, please include a link to it right at the beginning. Anyway, your problem is that $wgScriptPath is set incorrectly in your LocalSettings.php file - it should be "/biostat_annualreport", not "/wiki". Also, you can go back to using the remote YUI library - that wasn't the issue. Yaron Koren 15:25, 14 September 2009 (UTC)

Hmm, the current LocalSetting.php reads in line 119 $wgScriptPath      = "/biostat_annualreport";

and the wonderful autocompletion idea still does not work. I thought that maybe the variable is overwritten by some extension and thus added the statement $wgScriptPath = "/biostat_annualreport"; also at the end of LocalSettings but without luck. Thanks again very much for taking all the efforts! Thomas 14 Sep 2009 (18:41) (UTC).


 * Odd - can you do a search for the string "wiki" in LocalSettings.php? Yaron Koren 16:56, 14 September 2009 (UTC)

There is no interesting line in LocalSetting.php matching "wiki" really, and the html source of the form shows has the following line, below /*<![CDATA[*/

var wgScriptPath = "/biostat_annualreport"; and later below it says:



in which file of SemanticForms is this line generated? I would love to get this to work. Thomas 14 Sep 2009 (21:18)


 * Very odd. By any chance, is DefaultSettings.php being included within LocalSettings.php? It shouldn't be. Yaron Koren 19:33, 14 September 2009 (UTC)

Ooops. I had the include SemanticForms statement below the include DefaultSettings.php but above the wgScriptPath statement. Now it is working. Sorry for being such a beginner and thank you again very much for all your help! Thomas 15 Sep 2009 (10:35).


 * Cool. By the way, for anyone else reading this, I wrote the wrong thing - DefaultSettings.php should get included; but its settings should get overwritten right away Yaron Koren 12:23, 15 September 2009 (UTC)

Group values within dropdown menu
I am looking for a way to display the values of a dropdown menu in groups within the dropdown menu.

Example: 
 * Home
 * All Projects
 * Project 1
 * Project 2
 * Additional Menu Item

It does not have to be bullets, spaces would work...I just need a way to show that some values are "sub-values" of others.

Example:

Home

All Projects

-->Project 1

-->Project 2

Additional Menu Item

--Dgennaro 17:43, 14 September 2009 (UTC)


 * You can only do that if all those values are categories, by using the 'category' or 'categories' input types. Yaron Koren 19:34, 14 September 2009 (UTC)


 * Yeah, I was just hoping there was a more stylish way. Thanks.
 * --Dgennaro 14:48, 15 September 2009 (UTC)

Multiple Selection From Dropdown --jdpond 19:34, 2 October 2009 (UTC)
We've run across a situation where we'd like to use the "multiple" select feature in a field that uses "values . . .' or "Allows Value:" as a dropdown.

After examining SemanticForms/includes/SF_FormInputs.inc (specifically, SFFormInputs::dropdownHTML), I see that this feature is not enabled.

To do so, the code would require enhancement for:


 * Processing and imploding the selections on submit
 * Exploding and selecting previously entered selections
 * Enabling "multiple" selections

Existing parameters could be used to enable multiple selection including:
 * list - if specified, would allow/enable multiple selections
 * delimiter - specifies the delimiter that would/does separate the selected values

Is this in anybody's current dev/wish list, or should I take a shot at it? Is there any reason this would be undesireable?

Change order of instances?
I have forms for multiple instance templates working just fine. However, is it possible to change the order of those templates using semantic forms? For example:

If I want to move green to the top, I'd have to delete red and blue, and then click "add another" twice adding back red and blue. It would be great if you could change the order of the tablerow templates with up/down arrows while in the form. It this possible? --Gkullberg 14:15, 17 September 2009 (UTC)


 * Unfortunately, no. Yaron Koren 15:48, 17 September 2009 (UTC)


 * Is there any plan to introduce this feature? It would be a huge help. --Gkullberg 20:33, 18 September 2009 (UTC)

Change Display of CheckBoxes
Is it possible to change the display of checkboxes so that on the wiki page they are displayed as checkboxes, not as "true" or "false"? Or, if that is not possible, how can I change the output true/false? I would like to translate true/false to equivalents in my language. --Laquestianne 28. September 2009


 * You can specify a format string in queries: Type:Boolean on semantic-mediawiki.org. If you really have to use the parameter directly you could use one of the if-clauses from the Extension:Parser functions or - if you don't want to install that extension - you could define two templates Template:true and Template:false and call them, from your template: . In those templates you can then display whatever you like (e.g. images of a ticked/unticked checkbox). I like the first solution best as it clearly separates form from content, on the other hand it may be resource-consuming. --F.trott 14:24, 28 September 2009 (UTC)

ID change for the "Form" namespace
After upgrading http://groups.fsf.org to the latest versions of Mediawiki, SMW and SemanticForms, we have "lost" a few pages, such as http://groups.fsf.org/wiki/Form:GNU_Generation_project and http://groups.fsf.org/wiki/Special:AddData/GNU_Generation_profile.

The ID of the the Form namespace seem to have changed from 150 to 106. I have no idea why this happened and if it happened to other namespaces too. What would be the best way to recover the lost pages besides hacking the database? I'm not familiar with the Mediawiki schema, so I'm not sure if updating the page.page_namespace would be sufficient. Bernie74 00:21, 29 September 2009 (UTC)

update page set page_namespace=106 where page_namespace=150; update page set page_namespace=107 where page_namespace=151; update watchlist set wl_namespace=106 where wl_namespace=150; update watchlist set wl_namespace=107 where wl_namespace=151; update logging set log_namespace=106 where log_namespace=150; update logging set log_namespace=107 where log_namespace=151; update redirect set rd_namespace=106 where rd_namespace=150; update redirect set rd_namespace=107 where rd_namespace=151;
 * SOLVED: for the time being, I applied this kludge:


 * There may be more tables containing dangling references to the old namespaces. These are the ones I found by inspection.
 * Bernie74 00:21, 29 September 2009 (UTC)
 * Bernie74 00:21, 29 September 2009 (UTC)


 * Yes, that's the right way to do it; old versions of SF had an inconsistent way of defining the Form namespaces that led to this problem. Yaron Koren 15:17, 6 October 2009 (UTC)

How to point the "Edit Section" links to editing form?
This is a great extension. However, it may be not easy for some visitors to notice the pages are editable if we remove the "Edit Section" links. I am wondering if I can direct the "Edit Section" links to editing form? Thanks.


 * I can't think of any way to do that, unfortunately... Yaron Koren 13:02, 8 October 2009 (UTC)

Export to pdf
This wonderful extension could be used to write reports using inline queries. However, it seems not to be easy to produce a pdf of such text. I tried the Wiki2LaTeX and the Collection extensions, and both result in pdf's without the inline query results. Is there a way to produce a pdf from text with semantic query results? Any hint is very much appreciated! Tomy 8 Oct 2009 20:42.


 * That seems like a Semantic MediaWiki question, not a Semantic Forms one - I would write the mailing list with that question. Yaron Koren 01:55, 9 October 2009 (UTC)

No red links on my form !
Is it possible to have form whose information won't automatically generate links ? The problem is that the form I created contains some "textarea" inputso it can contain paragraphs... And I don't want these to became links...

Thanks in advance if you ave any thoughts about it.


 * It sounds like you just need to define the properties you're using in the templates - if they're not defined, then by default they're of type "Page", i.e. links. Yaron Koren 16:04, 12 October 2009 (UTC)
 * Ok I was using "string" and I changed it to "Text" but that was not the problem (I was using accents and I don't really know why but when I removed them from my properties it worked well). Only thing now is that the "edit boxes" became very small. So I have several rows but the size is only like 30. I tried to change it adding "|size=150" but in the form page but it doesn't do anything (this command worked before...). Do you have any idea? Also only the edit boxes fron the form are small: the free text box has a normal size.


 * That should work; is the right size showing up in the HTML source, at least? Yaron Koren 19:24, 14 October 2009 (UTC)


 * I tried to delete all my form and do it again (just in case) but it didn't change anything (even with different names). Anyway, on IE, my boxes are takins into account the "rows" parameter but not "size nor "cols". So I have a box with a size of 1 character but as many rows as I ask. The HTML code gives this:

table class="formtable"> tr> th> Environnement du probleme: /th>td> 	textarea tabindex="2" id="input_2" name="Fiche[Environnement du probleme]" rows="5" cols="80" class="mandatoryField" >/textarea> span id="info_2" class="errorMessage">/span> /td>/tr>
 * (I removed the "<" cause I don't know how to show the html here)
 * And then I have 3 other properties that looks the same. Weird thing is that I just tried on firefox and it works well... (I was testing on IE and I'd like it to work on IE)

and page name
Hi

I want to use the to create new pages, but after hitting the submit button, I want to change the name of the page which will be created e.g. if I enter "pagename" in the input field, I want a page like "example pagename example" to be created.

Is this possible?

Thanks for your help, Yves


 * That's a good idea, but unfortunately it's not possible - you'd have to use the one-step process instead. Yaron Koren 16:05, 12 October 2009 (UTC)


 * Thank you very much for the fast answer, Yves


 * Hi again, I found a workaround which works for me:


 * I use the widget extension with which I can create html code with javascript and forms.
 * I use the widget to create a form with some javascript which construct me a link for the one-step process
 * Here an example:

function myformtest{ jQuery("#forminput") .attr("action","/index.php/Special:AddData/NameOfTheForm/PageName"+jQuery('#mytext').val+"MoreText"); }   
 * Yves


 * Wow, that's very interesting. Yaron Koren 20:38, 12 October 2009 (UTC)

Proper placement of $sfgYUIBase
The documentation reads: ''in your LocalSettings.php file, below the inclusion of Semantic Forms, add the following line:

$sfgYUIBase=...''

My experience is that it only works if including above the inclusion of Semantic Forms. I am using Semantic Bundle. Could that be the difference? --Tosfos 16:44, 13 October 2009 (UTC)


 * That seems very odd; I have no idea. Yaron Koren 19:25, 14 October 2009 (UTC)

#formlink preload not operational
I am attempting to preload a field using the #formlink parser which, as I have read, is supposed to be possible.

Example:

My end result is to populate a hidden field with the page name that the #formlink is on. I keep receiving a "Bad title" error. I am currently using Semantic Forms v1.8.3

Thanks in advance.

--Dgennaro 19:29, 16 October 2009 (UTC)

mediawiki upgrade, loss of forms
I recently upgraded my wiki http://www.queenstown.net.nz from 1.9.3 to MediaWiki 1.15.1

I also upgraded to the latest version of Semantic Forms (Version 1.8.4)

But now my forms have disappeared! It's not that they don't work, it's just that there's redlinks where the links to the forms used to be.

e.g. http://www.queenstown.net.nz/index.php?title=Form:Add_Business_Form The templates for the forms still exist however.

However in my custom namespace 'staff' the forms appear although they do not work.

I am not an expert user but I created these forms through trial and error and I would like them back.

Any ideas?

--Andrewrutherford 22:22, 18 October 2009 (UTC)

How to show the edit toolbar above the free-text area?
Hi, How to show the edit toolbar above the free-text area? It would be great if the free text area looks like the original editing view. Thanks for help.