Extension talk:Page Forms

Clickable Uploaded File Links & Clickable User Page links
Sorry if my SMW forms terminology is off...Is it possible to make the results of an uploaded field clickable as an internal link to a file, such as the results of a field with URL type can do for an external link? Possible by changing the type to page and somehow prepending 'Media:' maybe at the floatbox upload form? In a similar line of questioning, how about a field with page type to be loaded with a username (currently done by using default= ). I would like them to point to User:username instead of username.


 * Yes, absolutely - that's how it's intended to be done. Your template should contain something like " Has file::File: ", with something similar (but with "User") for your other example. Yaron Koren 00:23, 1 June 2010 (UTC)


 * BRILLIANT, and thank you!


 * had to add a "|", but worked perfect as..
 * Has file::File:


 * I have the User:username working (even with multiple entries) using
 * " }}} "


 * Is there a way to display username but still point to User:username?


 * Great. Yes - just change the last part of that #arraymap call from Username::User:x to x . Yaron Koren 16:49, 1 June 2010 (UTC)


 * THANK YOU! and one last question: The uploaded file example above loads several images. I would like to automatically show them (if present) by added markup to template. I was successful in getting it to appear using an inline query:




 * The plain text output looks like: System Images File:Front Rack.jpg, File:Back Rack.jpg, File:Theater.jpg


 * I was hoping to get improve image presentation/formatting by getting it into a gallery. Am I on the right track attempting string manipulations (replacing comma with CR's, etc)? or is there a better in line query call you can think of?


 * Is your "Uploaded file" property of type "Page"? If so, those values should be getting displayed as images - if they're not, you may have found a bug in SMW. Yaron Koren 14:55, 2 June 2010 (UTC)


 * Yes, they did display mostly correctly via the above inline query (no bug) but they appear side by side with commas separating the images (as expected). I wanted to be able to clean them up with borders, size control, etc in a controlled gallery, or thumb'ed image. I realize this is getting out of SMW Forms, but I will update the thread if I can get it working.


 * I found that using the DPL Extension provides me the functionality I needed. This will created full featured thumbnailing. DPL Format control



Modifying forms
Hello !

I've seen you said that is really difficult, and, as I program a bit of php myself, I believe it. But you say we can edit it by hand, and... that's all. I'd be very thankful if you could tell us where to find the data I have to modify to add or remove fields in my forms.

Samuel Marchand 12:53, 2 June 2010


 * Sorry, I don't understand the question. This question might be better sent to the SMW users mailing list, being so (I think) open-ended. Yaron Koren 14:52, 2 June 2010 (UTC)


 * No problem, but I'll try to rephrase my question before posting it to the mailing list : in the paragraph "Getting Started" of this extension page, you say :


 * "this is programatically much harder to implement than creating new pages, because it requires parsing. For the foreseeable future, modifying existing properties, templates and forms will have to be done by hand."


 * So, if I'd like to modify an existing form, what should I search and modify ?


 * (I was reading my last question and thinking this wasn't understantable...)


 * Finally, I find the answer : I have to open the Form:nameOfMyForm page, and click on the "edit" tab. That's easy, but when you don't know it...


 * Samuel Marchand


 * Ah... I get it. Well, as I tell everyone, feel free to modify the documentation directly, if you think there's a clearer way of expressing it. Yaron Koren 16:34, 3 June 2010 (UTC)


 * Done. Could someone check if I've written correct English ? That's not my mother tongue...

Thankyou
@Yaron, I was not so fast as you archived last discussion page. So let me say thank you on the new discussion page for your tip with cite extension - it helped :-) - --Ulli 757 17:48, 3 June 2010 (UTC)


 * Great. Yaron Koren 03:11, 4 June 2010 (UTC)

Hide Edit Source Tab
I enabled $sfgRenameEditTabs=True giving me both 'edit' and 'edit source'. Can I remove the edit source tab wiki-wide leaving just edit to normal pages and edit (really edit with form) for smw form pages?

$wgGroupPermissions['*']['edit source']             = false; $wgGroupPermissions['user']['edit source']          = false; $wgGroupPermissions['sysop']['edit source']         = false; $wgGroupPermissions['bureaucrat']['edit source']    = false;

in LocalSettings.php didn't work?


 * The permission you should be using is not 'edit source', but 'viewedittab'. Yaron Koren 14:11, 4 June 2010 (UTC)


 * Thanks!

Default Loading of a Field with the Name of Page
I would like to automatically populate a 'Model Number' field within a form with the name of the page. If I call in free text area I can get the correct text. However using the below code, I get as the result. As a stretch I tried as used in default for uploads, but failed again.




 * Do you mean that shows up in the wiki text (and form), or that it shows up on the page itself? Yaron Koren 14:02, 6 June 2010 (UTC)

Hide 'Browse properties' Link
I am trying to hide the 'Browse properties' link on my sidebar. Sidebar is rendering via NavTree -Adding a treeview to the sidebar (if using monobook skin) if that matter.


 * That's a Semantic MediaWiki, not Semantic Forms, issue. Yaron Koren 14:03, 6 June 2010 (UTC)


 * Sorry, the lines can get a little blurred. Answer is hiding toolbar lists in common.CSS by #p-tb li { display: none !important; }

Floatbox Call
First off apologies for a question not exactly specific to SMW Forms. You are using the floatbox js extension the bring up a a special upload window for SMW forms. I have googled beyond belief in my attempt to implement a simple picture using floatbox in mediawiki. I do not want to enable HTML site-wide ($wgRawHtml = true;). Can you point me in the right direction, or give me an example?


 * Hi - indeed it's not related, but since you ask - there's already an extension that might do what you're looking for - LightboxThumbs (I believe "lightbox" has become the standard term for this kind of interface). If that doesn't do it, Widgets might be a good solution - though unfortunately, there's no lightbox widget yet, so you might have to either create one yourself, or ask someone (like Sergey) to do it. I should note that Semantic Forms itself will probably switch in the next few months to using one of the jQuery-based JS libraries, instead of Floatbox; for what it's worth. Yaron Koren 15:26, 6 June 2010 (UTC)

Difficulty with autocomplete on property
Greetings. I am having difficulty using autocomplete on property on any fields. I have created the property "Config item".
 * When I set to "property=config_item", the drop-down is created with the values as expected.
 * Tells me that there is no case-sensitivity or naming issue on property specification
 * However, when I set to "autocomplete on property=config_item", the autocomplete does not function.
 * When I set to "autocomplete on category=some-valid-category" it also works as expected.
 * Tells me that there's no problem with the YUI, etc.

So I am at a loss here. I feel like I might be missing something glaringly obvious. I have created properties of type text and string, but neither causes it to function. Any ideas or suggestions?

By the way, this extension is positively superb and has allowed me to present mediawiki as a viable option for our project. Can't thank you enough for this wonderful extension.

Thorncrag 20:27, 6 June 2010 (UTC)


 * Thanks, that's great to hear - it's always nice to hear about SF and SMW being used in place of more expensive, or custom, solutions. As to your question - what happens if you switch to "autocomplete on property=Config item"? It could be that this parameter is case- or underscore-sensitive, even though it shouldn't be. Yaron Koren 01:01, 7 June 2010 (UTC)
 * Hi Yaron, I've tried each combination, between capitalization and with/without underscores, none seem to resolve the issue. I may try creating an all new template, form, and property to test.  Thorncrag 19:36, 7 June 2010 (UTC)
 * I create a new property, template and form and still the same problem. The field will not autocomplete based on the new specified property.  Stumped.  Thorncrag 00:55, 8 June 2010 (UTC)


 * I would try duplicating this on a public wiki, like scratchpad.referata.com. Yaron Koren 03:17, 8 June 2010 (UTC)

Preloading template field values in FormEdit
Template field values supplied to the FormEdit special page (like [template_name]field_name=field value) either by typing them into the URL or via  or  query string parametre seem to be ignored. Urlencoding the query string (the template and fields names are non-latin; can this be the problem?) does not help. Can anyone give a link to a working example of calling a form with preloaded fields?


 * You can see a demo of #forminput here. Yaron Koren 22:12, 7 June 2010 (UTC)


 * Thanks, I misplaced the square brackets.


 * Great examples. I would love the option of default form selected (still changeable by user via drop down) and able to filter out certain options for the default form list. My thought was to redirect attempts to create new pages to.a single page which would facilitate settings categories via form selected/used. --Scott


 * "default form" and "listed forms" parameters are both reasonable ideas... I should note that very few people actually use the dropdown approach, from what I've seen. Yaron Koren 03:24, 8 June 2010 (UTC)

Semantic Forms Interwiki links
Hello all, On similar lines as the previous post, I wonder if Semantic Forms can work with Interwiki Links. I had a few articles with properties like - Idaho - before I installed Semantic Forms and SMW was working fine aggregating them and pointing "Idaho" to the wikipedia page (Idaho) both in the original page and in the aggregation page. But after I installed Forms, all my links show up as "wikipedia:Idaho" (as plain text) and are no longer linked to Wikipedia page. Can someone let me know how to correctly format the syntax so that I have the property-states linked to Wikipedia? Thanks!

Veryhuman 02:36, 8 June 2010 (UTC)


 * That seems strange - the same wiki-text in the page produced a different link on the page before and after Semantic Forms was installed? Are you sure about that? If so, that could be a serious bug. Yaron Koren 03:14, 8 June 2010 (UTC)


 * Yes, that is how it looks like. But maybe, I didnt go about doing it correctly and it may not be just due to installation of Semantic Forms. This is what I did. I had some pre-defined properties (state::,regnum::,habitat::)which were "interwikied" to Wikipedia entries of the property values and were behaving as expected. After I installed Semantic Forms, when I was setting up forms, the categories which were "interwikied" to Wikipedia were not visible (the non-interwikied ones (endemic::,height::) were visible). So I created exactly the same properties (state,regnum,habitat) using Semantic Forms CreateProperty and assigned them type "String" (Previously, I had not defined any type for the properties). Now I find that although the pages having these properties aggregate correctly, the names arent interwikied ( Idaho doesnt point to Idaho on Wikipedia) and instead generate an abnormal name w:Idaho for the property value.
 * Not sure if I did it correctly. Looking forward to this getting resolved! Thanks Yaron for the quick reply. Veryhuman 03:53, 8 June 2010 (UTC)


 * Maybe the issue is that the properties' types changed from "Page" (the default) to "String", then? Yaron Koren 04:10, 8 June 2010 (UTC)


 * Thanks Yaron, that (setting property-type to Page) works for most cases i.e. only where the property-value is interwikied to Wikipedia. However, if the property value has a REDIRECT page, it doesnt show up then. I'm trying to figure it out, but would appreciate your suggestion on this. Also, I was wondering if there is an inherent advantage to using the property-type String instead of Page?
 * Thanks again! Veryhuman 14:23, 8 June 2010 (UTC)


 * Cool. It sounds like it's not a Semantic Forms issue, then; and I don't know much about the interplay of interwiki links, redirects and properties. I'd suggest writing to the SMW users mailing list. Yaron Koren 14:34, 8 June 2010 (UTC)


 * Good! Thanks for the help Veryhuman 14:39, 8 June 2010 (UTC)

Create customized standard input buttons
Hello,

I was wondering if it is possible to create customized standard input buttons other than the seven default buttons (save, preview, changes, etc..) at the end of the forms. I would like to create a button that would save the form and immediately go back to edit mode using the same form for continual input. Basically when I am creating or editing a page with a form, I want a button at the end of that form to allow me to save changes and continue to edit within that form. Anyone have any idea how I would do this? Thanks

--Neezy 12:44, 8 June 2010 (UTC)


 * Hi - people have asked about that kind of thing; the more common request is for a button that saves the page, then redirects to another page. I don't think any of it's possible, though, because once the form is submitted, the control is out of SF's hands; and I don't think MediaWiki has the functionality to do such redirects. Yaron Koren 14:38, 8 June 2010 (UTC)

Must fields also be properties?
Hi, I'm testing Semantic Forms for this use case:
 * I have to maintain 60 records of the same type (programs)
 * I want to be able to add a field to all records at the same time without editing 60 program pages
 * I want to be able to add an option to a dropdown list without editing 60 programs
 * I would like to be able to query on a few fields, e.g. name, status, but most of the fields are unique to each program and don't need to be searchable/browsable (except by the normal wiki search feature)
 * I want to display help text at the top of all programs for new users, but hide it from experienced users - perhaps with a collapsable or scrollable text area, or a "read more" ajax link that won't pop people out of an edit & make them lose data

My questions are:
 * 1) Do I need to define properties for all of my fields, or just the ones I want to be able to search by?
 * 2) I can't see a way to define dropdown lists except by using properties
 * 3) Is there a GUI editor to add edit fields to existing forms & templates?

Thanks, Carole, 8 June 2010


 * Hi - (1) no, you don't need to define properties for fields; (2) use the "values" parameter for the "field" tag; (3) no, unfortunately. Yaron Koren 15:31, 8 June 2010 (UTC)

Thanks for your blindingly fast answer! SF will be a huge help for the use case.

Templates vs Forms
What's the relationship between templates & forms? Using the workflow in the extension documentation, and looking at the generated code, it appears that templates list fields, and forms are where the fields are defined, and templates are a great way to organize fields by subject for use in one or more forms.


 * 1) Do I need 1:M templates per form (e.g., I shouldn't build a form without a template)?
 * 2) When I'm modifying a field, e.g., to add "values" to the field, do I do this in the form?

Thanks, Carole, 8 June 2010


 * Hi - forms just help users edit calls to templates - you always need the template(s) first. For adding values to a field - you can do that in the form, using the "values" parameter, or in the property for that field, assuming there is one. Yaron Koren 16:20, 8 June 2010 (UTC)

References in SF and Form edit
Hi,

SF is really helping me build a great site. Thanks for the wonderful application. I had a couple of quick questions:

1) Is there a way to have References for the property values put in by the User? Right now, I have 2 columns - Property-name and Property-value. I'd like to have the proper references for the value in the third column and ideally, have the references show up in the in the proper format. I dont know how it can be accomplished, maybe its just asking for too much, or maybe its already a functionality (which would be awesome!). I'd be glad to have suggestions on that.

2) Once a create a form, I frequently feel like going back and editing it using the same interface used for creating the form. I wonder whether that can be done without messing up the customizations done in the Form CSS.

ThanksVeryhuman 23:34, 8 June 2010 (UTC)


 * Hi - I shudder to think at what you're doing (are users entering property names by hand?), but, in any case, the general answer to that is to use multiple-instance templates, ideally in conjunction with Semantic Internal Objects to store the data. And no, there's no way to re-edit forms using forms, unfortunately. Yaron Koren 01:32, 9 June 2010 (UTC)


 * Oh no! The property names are hard-coded in the template. The users enter the property values. To make my question more clear, for propertyX::valueY, where valueY is input by user, I would want them to also include the reference for that value and have that reference show up under References section. Veryhuman 02:35, 9 June 2010 (UTC)


 * Oh, sorry, now I get it - carry on, then. :) What I said before about multiple-instance templates and SIO is still valid, though. Yaron Koren 04:12, 9 June 2010 (UTC)


 * Got it! Thanks Yaron. Veryhuman 04:22, 9 June 2010 (UTC)