Demo VisualData 1.0 / Page upload

Page upload: Difference between revisions

From Wikisphere
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
The following form shows the use of PageProperties as a multiple file uploader fully customizable.     
The following form shows the use of PageProperties as a multiple file uploader fully customizable.     
 
The form below uses the following features:
The form below uses the following features:
* wikitext in either title and description of each item and subitem
* wikitext in either title and description of each item and subitem

Revision as of 16:14, 30 October 2023

The following form shows the use of PageProperties as a multiple file uploader fully customizable.

The form below uses the following features:

  • wikitext in either title and description of each item and subitem
  • subitem with multiple items and min-item attribute set to 1 (in order to hold the file and caption fields)
  • OO.UI.SelectFileWidget for the field "file" with input-config droppable and showDropTarget. Note that both the attributes must be set in order to enable a doppable area
  • value formula for the file field {{PAGEID}}-<value> in order to upload the file with a filename prefixed with the pageId of the current or created page. This is useful when you don't want to care of uploading files with same name on the wiki.
  • list of accepted mime-types editable in the file input config, accessible from the settings icon besides the dropdown with available inputs (see picture below)

(the caption associated to each file is simply a field besides the file field in the same subitem, other fields could be added as well)


{{#pagepropertiesform: Page upload |title = Page upload |action = edit |edit-page = |return-page = |view = inline |popup-size = medium |css-class = |pagename-formula = |edit-freetext = false |edit-categories = false |edit-content-model = false |default-categories = tasks |default-content-model = |layout-align = top |popup-help = true |submit-button-text = |layout = tabs |submit-button-text = |validate-button-text = }}


This is the code to display the form-button

{{#pagepropertiesform: Page upload
|title = Page upload
|action = edit
|edit-page = 
|return-page = 
|view = popup
|popup-size = medium
|css-class =
|pagename-formula = 
|edit-freetext = false
|edit-categories = false
|edit-content-model = false
|default-categories = tasks
|default-content-model = 
|layout-align = top
|popup-help = true 
|submit-button-text =
|layout = tabs
|submit-button-text =
|validate-button-text =
}}


Also note that although the "Page upload" schema is now used inside a form, its typical use would be to add it to whatever page of the wiki through the "Edit semantic" tab, and then adding it to the page. This way there is no need to create a form each time.


{{#pagepropertiesprint: Demo VisualData/Page upload |?files/file |?files/caption |schema=Page upload |template=Page upload |template?files=Page upload files }}

pageproperties

schemas
Page upload
files
file"File:433-Screenshot from 2023-10-29 07-40-06.png"
caption"cap a"
file"File:433-Screenshot from 2023-10-28 04-05-12.png"
caption"cap b"
schemas-data
untransformed
Page upload/files/0/file"Screenshot from 2023-10-29 07-40-06.png"
Page upload/files/1/file"Screenshot from 2023-10-28 04-05-12.png"