Extension talk:Page Forms

Help with using Semantic Forms and Database extension together
Hello. I have a namespace 'main' (the default, obviously) which contains a couple of Semantic Forms to add new articles. However, I'm trying to use the Database extension in a separate namespace (called KE - short for Known Errors) which adds numbered prefixes in sequential order (e.g. KE-001: ARTICLE NAME). Long story short, I want to use Semantic Forms in conjunction with this.

The Database extension uses its own special page (Special:Database) to scan for previous entries and add the next one. This is probably a long shot, but I want to pass the information/text used to create a normal article using Semantic Forms to this Special:Database page (which in turn will give it the prefix). Is this possible?

I doubt I need to use a separate namespace, so I can remove that if it makes things simpler.

I've mentioned it on the Database extension's talk page, but it's dead. Thanks. Csf90 12:06, 1 December 2011 (UTC)


 * I don't think I understand this question. What's an example of the kind of information that would be passed? Yaron Koren 23:37, 1 December 2011 (UTC)


 * The content entered into my 3 fields on my form. For example, when creating a new article using SF, first there's an article name page, whereby the user inputs the name of the article. Clicking 'Create' then takes them to the next page, which has 3 input boxes (that I set up using templates/properties/fields). After entering information into these 3 boxes and clicking continue, the article/page is created. However I want the information to be passed to the Special:Database page, rather than the default of the new page it's creating.


 * In terms of an example of the information that's being passed - just the MediaWiki syntax that the page composes of. For example...


 * Csf90 09:34, 2 December 2011 (UTC)


 * Ah, okay. I just read about the Database extension - I had never heard of it before. (I should note that I find "Database" a very odd name for an extension that, as far as I can tell, just hands out unique IDs.) Anyway, maybe there's a simpler solution, that doesn't involve using Database at all - what about using the one-step process, with a page name formula that includes "&lt;unique number&gt;"? Yaron Koren 09:43, 2 December 2011 (UTC)


 * Thanks for the suggestion, that sounds more appropriate. Funnily enough the Extension:Database has just had a warning flagged on its page saying it contains a major security flaw! Anyway, had a read of the link you provided and checked the form code, but having some difficulty figuring out how to add it (not a big MediaWiki programmer, just been delegated the task). Do I need to change the #forminput to #formlink? Where should the  tag go? Thanks for your help so far. Csf90 16:05, 2 December 2011 (UTC)


 * Cool. Yes, you need to change #forminput to #formlink, and the form should have a line above the first "for template" tag, reading " ", or something like that (I didn't quite understand your naming convention.) Yaron Koren 17:44, 2 December 2011 (UTC)


 * Thanks, that works perfectly. Last question (I promise!) - is it possible to have both the KE- prefix as well as an article name? At the moment, each article is name KE-001, KE-002 etc. Ideally, there could be a text box to input an article title in and then it creates KE-001: Article Name. I assume this may not be possible as that would require some kind of combination between #forminput and #formlink, rather than 1 or the other. Either way, it is better now than it was before, so thank you for that :) Csf90 13:19, 6 December 2011 (UTC)

Well, that's a tricky one - you could have a formula like "KE-: Article[Title]", but the number won't be sequential - it'll create pages like "KE-001: ABC", "KE-001: DEF", "KE-002: ABC", etc. - i.e., only the minimum number to ensure a unique page name. Having it create page names in the way you want would probably require some custom coding, unfortunately. Yaron Koren 14:47, 6 December 2011 (UTC)

Text areas becoming truncated when they contain preformatted text
I am using SemanticBundle-20110824.tgz with MEdiawiki 1.16.5.

I have created a semantic form which is working successfully.

I have a text area in the form which is not linked to a SMW property at all, but simply works as a property of the template

The content of that text area contains will sometimes contain   tags so that the | and other mediawiki characters are escaped properly.

This all works fine.

The problem is that when I edit an existing page by clicking the "Edit with Form" link at the top of the page, the content of the textarea gets truncated to the first '|' even though the '|' is within a   tag.

Is there any other form of escaping I can perform in the text that will allow the edit with form function to load the entire content of this field?


 * That's a problem, yes. It's a hack, but what you could do instead is create a template at "Template:!", and put just the single character "|" in that page. Then, instead of the pipe, put "|" in any page. That's a standard MediaWiki hack, actually, used in a variety of contexts. Yaron Koren 23:40, 1 December 2011 (UTC)

Problems Using the Upload Forms Pop-up Box
I am using SemanticBundle-20110824 and MW 1.17.0.

I have two problems: (i) when I click on Upload form, it takes me to a full page instead of the pop-up box and (ii) when I click browse nothing happens, no explorer window to navigate to the file I wish to upload).

In my error log, MW did not like Semantic Bundle accessing SMW and SF thru the old pathway instead of the newer one (SMW_Settings.php vs SemanticMediaWiki.php). Changing the includes/require_once pathway looks to have resolved problem #1. Problem #2 still persists.

I am also importing several Javascripts using importScriptURI. Commenting out the JS does not help.

--2nd Update-- Since I know little about Javascript, I wondered if the vector skin or JS implemented through the gadgets extension was coming into conflict. Disabling both did not help.


 * I assume the issue is Javascript problems coming from somewhere. Try looking at the Javascript console with either Google Chrome or Firefox with the Firebug extension, and see if any error messages show up there. Yaron Koren 22:02, 2 December 2011 (UTC)


 * Yaron, First of all thank you for the response and for all of your hard work on Semantic Forms and Semantic Internal Objects.


 * I had trouble finding a version of Firebug to work on Firefox 3.6. I upgraded to Firefox 8, and the problems went away. I feel a little stupid right now. Let this be a lesson to everyone, make sure you are running the latest, or at least relevant, versions.


 * Okay, that's good to know - Firefox 3.6 is actually only about two years old, but I guess a newer version is needed. Yaron Koren 05:44, 6 December 2011 (UTC)

Button for multiple-instance
Great extension. Button for multiple-instance templates doesn't work with Extension:Picasa2Gallery. 2.14.89.211 00:25, 6 December 2011 (UTC)


 * I just looked at that extension - it's seriously old; it hasn't been updated since MW 1.15. I'm surprised that it's working for you even by itself... anyway, that's good to know. Yaron Koren 03:20, 6 December 2011 (UTC)

Values from namespace - Main namespace
Hello, just for confirming and improving documentation. In a Spanish MediaWiki (Main -> Principal namespace), I see that values from namespace=Principal is not working. It works values from namespace= though. --Toniher 10:27, 7 December 2011 (UTC)


 * Thanks for letting me know about that - I just checked in a fix in SVN. Yaron Koren 19:45, 7 December 2011 (UTC)

Automatically lowercase name of page created with form?
Is it possible to automatically lowercase the name of a page created with a form? I tried putting the "lc" (lowercase) magic work around "forminput" in my form and it didn't automatically lowercase the name of the page. Thank you so much 162.89.0.60 16:56, 8 December 2011 (UTC)


 * Do you have $wgCapitalLinks set to false? Yaron Koren 19:14, 8 December 2011 (UTC)
 * It is not set and therefor its the default value (true), however, I may have been unclear. So I have a form that allows people to create a new page. They enter the name of the page they want to create and press "submit" and are taken to the form to create the page. Some people choose to capitalize every word in the page name (e.g., My Awesome Page"), while others choose to lowercase every word in the page name (e.g., "my awesome page"). I was hoping there was a way to automatically lowercase any title a user chooses so that "My Awesome Page" would turn into "My awesome page," thereby following the standard mediawiki page name formatting. There is a way to do this with every other form field by using string, but not when creating the name. 162.89.0.60 21:21, 8 December 2011 (UTC)


 * Oh, I see. I don't think there's a way to do that, and I'm leery about adding that kind of functionality in, because so far SF is pretty fastidious about not modifying people's inputs. (I assume the "lc" call you're doing for other fields is in the template, i.e. it affects the display of those fields, but not the underlying wiki-text.) Anyway, what about words that should be capitalized, like proper nouns and such? Yaron Koren 00:23, 9 December 2011 (UTC)
 * That's actually a good point. My wiki compiles camp and after school games, so there aren't a lot of page names with proper nouns. Thanks for being such a rock star developer by the way. I just noticed recently that you are responsible for like 90% of the mediawiki extensions I use!


 * Hey, thanks! I'm glad you're making good use of all the SMW-based functionality. Yaron Koren 04:51, 9 December 2011 (UTC)

Auto create page name, page property, link updates?
I don't think this is possible, but...? I use a form to create a page from the form data. I understand I can I have a field with a Page property to allow links to other pages. If the page doesn't exist(red link), I can create the new page. Here is the question, I would manually have to go back and update the page links. Is there a way I pass them back to the original page where they occurred in the field? Otherwise, I would continue to have red links to pages that don't exist. Or would I be better off listing a query of association with a link to create the new page with the linking association? Use Categories to make the association? Thanks Hutchy68 22:37, 8 December 2011 (UTC)


 * I don't understand this. Could you use an example? Yaron Koren 00:26, 9 December 2011 (UTC)


 * Thanks for replying Yaron - I Create a page with fields First and Last Name, say the page is "John Smith (unique#)" On John Smith's page there is a 'Page Field' called - "Person(s) associated with" which contains, Mark Jones, Tom White and Steve Black. So I click "Mark Jones" but the page name after creation would be "Mark Jones (unique#)" because the form creates the page name from the first, last and variable. Under John Smith's page, the field still contains "Mark Jones" and not "Mark Jones (unique#)" I have to use the unique number because I could have more than one person with the same name. Hutchy68 02:31, 9 December 2011 (UTC)


 * Oh, I get it. No, there's no automatic way to do that kind of modification. And since this is a symmetrical relationship, I can't think of a query-based solution either. Maybe the right answer is to not link to such pages until they've already been created. Yaron Koren 04:49, 9 December 2011 (UTC)

Display data from form fields on a page in a different order than they are displayed in the form?
I was wondering if it was possible to have a page populated with data from a form, but the data is not in the same order as it was displayed in the form. So the form would ask some one to enter the date, the description, some tags, and a picture, but when displaying data on the page, the order could be changed to date, picture, description, tags. I ask because I would like to use your extension header tabs. I would like for the pictures to be displayed on a separate "pictures" tab. That would mean that in the form, the picture upload field would have to be either at the bottom of the page or before the code. I would like the picture upload field to be right under the description so that its intuitive to users that the pictures are relevant to the description, but in the page, it would be nice if the pictures were actually at the botttom of the page so that they would be on their own tab all by them self. I hope this makes sense. I know you're dealing with Referata stuff, but thanks for all the time you spend answering our questions. 70.112.0.226 02:11, 9 December 2011 (UTC)


 * You might be able to do this by displaying that data via a query, instead of directly showing it - it all depends on your data structure. This question might be better asked at the semediawiki-user mailing list, with the form and template code listed, since the answer might be complex. (Also, Header Tabs isn't my extension, though I help maintain it - another guy wrote most of the code.) Yaron Koren 04:56, 9 December 2011 (UTC)

dissapearing default form text
Is it possible to include some dissapearing default form text like at the following page? Thank you. http://www.web-source.net/javascript_disappearing_form_text.htm


 * Yes, placeholder text - as of version 2.3, you can add that using the "placeholder=" parameter. Yaron Koren 20:07, 11 December 2011 (UTC)

Image not showing after upload
I have the same problem as this (found in archives of the Talk pages)

Unfortunately, the solution was done for the person in the above example and so I have no idea what fixed it.

My problem: Image uploads, shows the file in the form (confirmed that File exists in Special Pages) but won't display image on page.

Not only have I searched the archives here, I've gone through other forums and the mailing list and been trying everything possible to see if its Data-types, Properties, Internal Objects...but I'm over my head and would really appreciate some direction.

My test form is here

MediaWiki 1.17.0 PHP 5.2.17 (cgi-fcgi)MySQL 5.0.91-log Semantic Bundle (Version 2011-08-24.20110824) Dave88008


 * It's just an issue in the template - instead of "[[Image::]]", you should have "[[Image:]]" . Yaron Koren 01:37, 13 December 2011 (UTC)
 * Thank you so much - that was it!!! Dave88008