Difference between revisions of "Template:SMWDefaultMarkup"

From Wikispooks
Jump to navigation Jump to search
(Add [[Property::Has noRatings]])
(Set __NOCACHE__ if the page was modified within the last 36 hours)
Line 25: Line 25:
 
SET DISPLAY PROPERTIES -->[[Display image::{{Display image|{{FULLPAGENAME}}}}| ]]{{Display docType}}{{Display date}}{{ON display date}}{{Display lifespan}}<!--
 
SET DISPLAY PROPERTIES -->[[Display image::{{Display image|{{FULLPAGENAME}}}}| ]]{{Display docType}}{{Display date}}{{ON display date}}{{Display lifespan}}<!--
  
SET RATING PROPERTIES -->{{#ifeq: {{#ask: [[Constitutes::Rating]][[Has target::{{FULLPAGENAME}}]]|format=count}}|0||[[Has averageRating::{{#expr: {{#ask:[[Constitutes::Rating]][[Has target::{{FULLPAGENAME}}]]| ?Has value| format=average}} round 1}}| ]]}}[[Has noRatings::{{#ask: [[Constitutes::Rating]][[Has target::{{FULLPAGENAME}}]]|format=count}}| ]]</includeonly>
+
SET RATING PROPERTIES -->{{#ifeq: {{#ask: [[Constitutes::Rating]][[Has target::{{FULLPAGENAME}}]]|format=count}}|0||[[Has averageRating::{{#expr: {{#ask:[[Constitutes::Rating]][[Has target::{{FULLPAGENAME}}]]| ?Has value| format=average}} round 1}}| ]]}}[[Has noRatings::{{#ask: [[Constitutes::Rating]][[Has target::{{FULLPAGENAME}}]]|format=count}}| ]]<!--
 +
 
 +
Set __NOCACHE__ if the page was modified within the last 36 hours (129600 seconds)
 +
-->{{#ifexpr: {{#expr: {{#time: U | now }} - {{#time: U | {{#show: {{FULLPAGENAME}} | ?Modification date}} }} }} < 129600 |__NOCACHE__}}</includeonly>

Revision as of 14:17, 18 April 2016

This template adds SMWData to the page, based on the existing data. It has no parameters. It is currently simple, and should probably remain that way, because it affects so many pages and has the potential to tie up the SMW jobs queue.


The following properties are set: