Difference between revisions of "Template:SMWDefaultMarkup"

From Wikispooks
Jump to navigation Jump to search
m (Text replacement - "__NOCACHE__" to "")
Line 26: Line 26:
 
<hr/>
 
<hr/>
 
2016-04-18: Addition:
 
2016-04-18: Addition:
It also adds "<nowiki>__NOCACHE__</nowiki>" if the page was modified within the last 36 hours.</noinclude><includeonly>[[Has fullPageName::{{FULLPAGENAME}}| ]][[Has fullPageNamee::{{FULLPAGENAMEE}}| ]]{{#ifeq: {{ns:}}||[[Has parentFullPageName::{{#titleparts: {{FULLPAGENAME}} | -1 }}| ]]}}[[Has revisionSize::{{REVISIONSIZE}}| ]][[Has revisionUser::{{REVISIONUSER}}| ]]<!--
+
It also adds "<nowiki></nowiki>" if the page was modified within the last 36 hours.</noinclude><includeonly>[[Has fullPageName::{{FULLPAGENAME}}| ]][[Has fullPageNamee::{{FULLPAGENAMEE}}| ]]{{#ifeq: {{ns:}}||[[Has parentFullPageName::{{#titleparts: {{FULLPAGENAME}} | -1 }}| ]]}}[[Has revisionSize::{{REVISIONSIZE}}| ]][[Has revisionUser::{{REVISIONUSER}}| ]]<!--
  
 
Below two maybe handy, but currently unused:
 
Below two maybe handy, but currently unused:
Line 38: Line 38:
 
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 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)
+
Set 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__}}<!--
+
-->{{#ifexpr: {{#expr: {{#time: U | now }} - {{#time: U | {{#show: {{FULLPAGENAME}} | ?Modification date}} }} }} < 129600 |}}<!--
  
 
SET PROPERTIES IF NEEDED.
 
SET PROPERTIES IF NEEDED.

Revision as of 09:54, 17 February 2018

This template adds SMWData to the page, based on the existing data. It has no parameters. It is currently fairly 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:


2016-04-18: Addition: It also adds "" if the page was modified within the last 36 hours.