Difference between revisions of "Template:Bugfix SMW hased URI"

From TDWG Terms Wiki
Jump to: navigation, search
m (removed category)
m (+property)
Line 5: Line 5:
  
 
So this template checks if the final character is a # and adds “%20” to it (a blank character urlencoded). This fixes somehow the storage of # URLs. In addition  
 
So this template checks if the final character is a # and adds “%20” to it (a blank character urlencoded). This fixes somehow the storage of # URLs. In addition  
* [[:Category:Internal - SMW bugfix URI hashed]] should be set manually
+
* [[:Category:Internal - SMW bugfix URI hashed]] is set
  
 
== Usage ==
 
== Usage ==
  
Use it only to set ''hidden'' properties:
+
  <nowiki>{{</nowiki>{{PAGENAME}}|uri=http://www.w3.org/2004/02/skos/core#<nowiki>|property=vann:preferredNamespaceUri}}</nowiki>
  {{#set: vann:preferredNamespaceUri|<nowiki>{{</nowiki>{{PAGENAME}}|http://www.w3.org/2004/02/skos/core#<nowiki>}}}}</nowiki>
+
  
Or with parameter (if URL has ‘=’ in it)
+
 
{{#set: vann:preferredNamespaceUri|<nowiki>{{</nowiki>{{PAGENAME}}|uri=http://www.w3.org/2004/02/skos/core#<nowiki>}}}}</nowiki>
+
== Parameters ==
{{#set: vann:preferredNamespaceUri|<nowiki>{{</nowiki>{{PAGENAME}}|1=http://www.w3.org/2004/02/skos/core#<nowiki>}}}}</nowiki>
+
 
 +
{| class="vertical-align-top"
 +
|-
 +
| 1=<br />uri= || (mandatory) uri value
 +
|-
 +
| property= || (mandatory) the property to set
 +
|}
  
 
[[Category:Bugfix]]
 
[[Category:Bugfix]]
 
</noinclude><includeonly><!--
 
</noinclude><includeonly><!--
 
-->{{#ifexpr: {{#rpos: {{{1|{{{uri|}}}}}}|#}} = ({{#len: {{{1|{{{uri|}}}}}}}} - 1)<!--
 
-->{{#ifexpr: {{#rpos: {{{1|{{{uri|}}}}}}|#}} = ({{#len: {{{1|{{{uri|}}}}}}}} - 1)<!--
then-->|{{{1|{{{uri|}}}}}}%20<!--
+
then-->|{{#set: {{{property|}}}={{{1|{{{uri|}}}}}}%20}}[[:Category:Internal - SMW bugfix URI hashed]]<!--
else-->|{{{1|{{{uri|}}}}}}<!--
+
else-->|{{#set: {{{property|}}}={{{1|{{{uri|}}}}}}}}<!--
 
-->}}<!-- end if
 
-->}}<!-- end if
 
--></includeonly>
 
--></includeonly>

Revision as of 13:42, 6 September 2016

Problem: Semantic MediaWiki

So this template checks if the final character is a # and adds “%20” to it (a blank character urlencoded). This fixes somehow the storage of # URLs. In addition

Usage

{{Bugfix SMW hased URI|uri=http://www.w3.org/2004/02/skos/core#|property=vann:preferredNamespaceUri}}


Parameters

1=
uri=
(mandatory) uri value
property= (mandatory) the property to set