MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
Blanked the page
No edit summary
(Blanked the page)
Line 1: Line 1:
Some tips and tricks for using Semantic Mediawiki.


var myli = "div.thumbs ul l";
== Other tip sources ==
if ($(myli).html()) {
alert("hi");


$(myli).hover(function() {
http://smwforum.ontoprise.com/smwforum/images/a/ad/Manual_SMW.pdf
$(this).css({'z-index' : '10'}); /*Add a higher z-index value so this image stays on top*/  
$(this).find('img').addClass("hover").stop() /* Add class of "hover", then stop animation queue buildup*/
.animate({
marginTop: '-110px', /* The next 4 lines will vertically align this image */  
marginLeft: '-110px',
top: '50%',
left: '50%',
width: '174px', /* Set new width */
height: '174px', /* Set new height */
padding: '20px'
}, 200); /* this value of "200" is the speed of how fast/slow this hover animates */


} , function() {
http://smw.referata.com/wiki/Special:BrowseData/Tips
$(this).css({'z-index' : '0'}); /* Set z-index back to 0 */
 
$(this).find('img').removeClass("hover").stop()  /* Remove the "hover" class , then stop animation queue buildup*/
http://smwforum.ontoprise.com/smwforum/index.php/Example:All_libraries
.animate({
 
marginTop: '0', /* Set alignment back to default */
http://help.wikia.com/wiki/Help:Semantic_MediaWiki/Tips_and_tricks
marginLeft: '0',
 
top: '0',
(from mailing list)
left: '0',
 
width: '100px', /* Set width back to default */
== Data design ==
height: '100px', /* Set height back to default */
 
padding: '5px'
http://www.mediawiki.org/wiki/Extension:Semantic_Forms#Data_design_issues
}, 400);
 
});
- Create a top category for Semantic Classes. I called mine 'Categories'.
It holds only categories used to define a 'Is-a' relationship. Doing so has
at least two benefits : 1- You can do a query on your core content by
restricting it to the 'Categories' level. 2- You can define other
categories outside of that structure for whatever your system needs.
 
http://smwforum.ontoprise.com/smwforum/index.php/Example:How_to_realize_a_range_constraint_for_a_property
 
Redirects can be used to create property synonyms.
 
== Discussion ==
 
Categories can be hierarchical; properties can't (yet).
 
 
== MW tricks ==
 
If you want to clear out old pages you can delete them and use
deleteArchivedRevisions.php to erase the deleted revisions from the
database.
 
=== Variables ===
 
You can make use of the VariablesExtension [1] and store the query (or its
result? I'd like to know which one, but in the end it doesn't really matter) in
a variable, which is helpful when you need the same query multiple times within
a page. It looks like this:
 
{{ #vardefine: some_variable_name | {{#show:{{PAGENAME}}| ?propertyname}} }}
(silent) or
{{ #vardefineecho: some_variable_name | {{#show:{{PAGENAME}}| ?propertyname}} }} (with output)
 
Further down in the page you can write
 
  {{ #var: some_variable_name }}
 
=== Specific searches ===
 
  <nowiki>
  <inputbox>
  type=search
  width=30
  namespaces=Help**,Wikipedia**,Template**
  searchbuttonlabel=Search help pages
  bgcolor=#cee0f2
  break=no
  </inputbox>
  </nowiki>
 
(requires the Input Box extension)
 
=== Profiling mediawiki ===
 
http://www.mediawiki.org/wiki/How_to_debug#Profiling
 
== SMW tricks ==
 
<nowiki>[[Went past deadline::{{#expr:{{{End date|}}}>{{{Deadline|}}} }}]]</nowiki>
 
=== Hiding set data ===
 
  <nowiki>[[propertyA::{{{propertyA|}}}|]]</nowiki>
 
By adding the | after the enclosing }}}, the property value will not show.
 
For multi value properties:
 
  <nowiki>{{#arraymap:{{{Eating disorders behaviors|}}}|,|x|[[Eating disorders behaviors::x|]]}}</nowiki>
 
== Misc ==
 
=== Enable links in property values ===
 
$smwgLinksInValues = true;
 
=== Must add namespaces to config ===
 
Otherwise they won't have semantic properties.
 
$smwgNamespacesWithSemanticLinks array
 
== Media ==
 
Neat talk on MW, with refs to SMW: http://www.youtube.com/watch?v=Ukytqe9pwDM
 
[[Semantics]]

Navigation menu