Difference between revisions of "Transcluding People Pages on Other Wikis"

From Tsadra Commons
Jump to navigation Jump to search
((by SublimeText.Mediawiker))
((by SublimeText.Mediawiker))
Line 6: Line 6:
  
 
===Template:PersonCall===
 
===Template:PersonCall===
 +
 
<pre>
 
<pre>
  
 +
{{#get_web_data:url=https://commons.tsadra.org/index.php?title=Special%3AAsk&q={{urlencode:[[{{PAGENAME}}]]}}&po=MainNameWylie%0AMainNameTib%0AMainNamePhon%0AYearBirth%0AYearDeath%0ATibDateGender%0ATibDateElement%0ATibDateAnimal%0ATibDateRabjung%0ABdrcLink%0ATolLink%0AHarLink%0ADnzClassification%0ADnzNotes%0AImages&p[format]=csv&p[sep]=,|format=csv with header|data=MainNameWylie=MainNameWylie,MainNameTib=MainNameTib,MainNamePhon=MainNamePhon,YearBirth=YearBirth,YearDeath=YearDeath,TibDateGender=TibDateGender,TibDateElement=TibDateElement,TibDateAnimal=TibDateAnimal,TibDateRabjung=TibDateRabjung,BdrcLink=BdrcLink,TolLink=TolLink,HarLink=HarLink,DnzClassification=DnzClassification,DnzNotes=DnzNotes,Images=Images}}
  
{{#get_web_data:url=https://commons.tsadra.org/index.php
+
<div class="white-box depth-2" style="overflow: auto; max-width: 900px;">
?title=Special%3AAsk
 
&q=[[{{{PAGENAMEE}}}]]
 
&po=MainNameTib%0A
 
MainNamePhon%0A
 
YearBirth%0A
 
YearDeath%0A
 
TibDateGender%0A
 
TibDateElement%0A
 
TibDateAnimal%0A
 
TibDateRabjung%0A
 
BdrcLink%0A
 
TolLink%0A
 
HarLink%0A
 
DnzClassification%0A
 
DnzNotes%0A
 
Images
 
&p[format]=csv
 
&p[sep]=,
 
|format=csv with header
 
|data=
 
translatorlibwiki=translatorlibwiki,
 
citation=citation,
 
frontcoverimg=frontcoverimg
 
}}
 
<div class="white-box depth-2" style="overflow: auto;">
 
 
 
<div class="white-box-header"><i class="fa fa-user" aria-hidden="true"></i> {{PAGENAME}}</div>
 
  
 
<div class="person-images" style="float: right; margin-left: 7px;">
 
<div class="person-images" style="float: right; margin-left: 7px;">
Line 48: Line 23:
 
|}}
 
|}}
 
</div>
 
</div>
 +
<div class="plainlinks" style="padding: 15px">
 +
<span style="font-size: x-large;">{{#external_value:MainNameTib}}</span><br>
 +
{{#external_value:MainNameWylie}}{{#if:{{#external_value:MainNamePhon}}|&nbsp;<span style="color: #ea4100;">•</span>&nbsp;{{#external_value:MainNamePhon}}|}}
 +
 +
<hr style=" color: #ea4100; background-color: #ea4100">
 +
 +
{{#external_value:YearBirth}} - {{#external_value:YearDeath}}<br>
 +
{{#external_value:TibDateGender}} {{#external_value:TibDateElement}} {{#external_value:TibDateAnimal}}, Rabjung {{#external_value:TibDateRabjung}}
 +
 +
<hr style=" color: #ea4100; background-color: #ea4100">
 +
<!-- This section can include any info specific to the wiki -->
 +
<dl>
 +
<dt>DNZ Notes</dt>
 +
<dd>{{#external_value:DnzNotes}}</dd>
 +
</dl>
 +
 +
<hr style=" color: #ea4100; background-color: #ea4100">
 +
 +
[https://commons.tsadra.org/index.php/{{PAGENAMEE}} Full profile in Commons wiki <i class="fas fa-arrow-right"></i>]
 +
 +
[{{#external_value:BdrcLink}} BDRC Link <i class="fas fa-arrow-right"></i>]
 +
 +
[{{#external_value:TolLink}} Treasury of Lives Link <i class="fas fa-arrow-right"></i>]
  
<span style="font-size: x-large;">{{#external_value:MainNameTib}}</span>
+
</div>
  
 
</div>
 
</div>
 +
 +
{{#ask: [[Category:{{PAGENAME}}]] [[Category:Tibetan texts]]
 +
  | ?FullTitleWylie
 +
  | ?VolumeNumber
 +
  | ?PageNumbers
 +
  | ?TextNumberInVolume
 +
  | sort=VolumeNumber,TextNumberInVolume
 +
  | order=asc,asc
 +
  | format=template
 +
  | template=PersonContributions
 +
  | intro=<h2>Works by this person</h2>
 +
  | limit=10000
 +
}}
  
 
</pre>
 
</pre>

Revision as of 11:34, 2 February 2018

This wiki is setup so that data from the people pages here can be included in other wikis. This allows for us to only need to create and maintain a person's page once and in one place.

Now, in order to include this data on a different wiki, you will need to create a template that first queries for the information on this wiki here, and then displays it appropriately in the receiving wiki.

I have created a standard template here that can be adapted as needed for each wiki on which it is used.

Template:PersonCall[edit]


{{#get_web_data:url=https://commons.tsadra.org/index.php?title=Special%3AAsk&q={{urlencode:[[{{PAGENAME}}]]}}&po=MainNameWylie%0AMainNameTib%0AMainNamePhon%0AYearBirth%0AYearDeath%0ATibDateGender%0ATibDateElement%0ATibDateAnimal%0ATibDateRabjung%0ABdrcLink%0ATolLink%0AHarLink%0ADnzClassification%0ADnzNotes%0AImages&p[format]=csv&p[sep]=,|format=csv with header|data=MainNameWylie=MainNameWylie,MainNameTib=MainNameTib,MainNamePhon=MainNamePhon,YearBirth=YearBirth,YearDeath=YearDeath,TibDateGender=TibDateGender,TibDateElement=TibDateElement,TibDateAnimal=TibDateAnimal,TibDateRabjung=TibDateRabjung,BdrcLink=BdrcLink,TolLink=TolLink,HarLink=HarLink,DnzClassification=DnzClassification,DnzNotes=DnzNotes,Images=Images}}

<div class="white-box depth-2" style="overflow: auto; max-width: 900px;">

<div class="person-images" style="float: right; margin-left: 7px;">
	{{#if:{{#external_value:Images}}|
		{{#tag:gallery
			|{{#external_value:Images}}
			|mode="slideshow"
			|heights=500px
			|class="reduced-margins"
		}}
	|}}
</div>
<div class="plainlinks" style="padding: 15px">
	<span style="font-size: x-large;">{{#external_value:MainNameTib}}</span><br>
	{{#external_value:MainNameWylie}}{{#if:{{#external_value:MainNamePhon}}| <span style="color: #ea4100;">•</span> {{#external_value:MainNamePhon}}|}}

	<hr style=" color: #ea4100; background-color: #ea4100">

	{{#external_value:YearBirth}} - {{#external_value:YearDeath}}<br>
	{{#external_value:TibDateGender}} {{#external_value:TibDateElement}} {{#external_value:TibDateAnimal}}, Rabjung {{#external_value:TibDateRabjung}}

	<hr style=" color: #ea4100; background-color: #ea4100">
	<!-- This section can include any info specific to the wiki -->
	<dl> 
		<dt>DNZ Notes</dt>
		<dd>{{#external_value:DnzNotes}}</dd>
	</dl>

	<hr style=" color: #ea4100; background-color: #ea4100">
	
	[https://commons.tsadra.org/index.php/{{PAGENAMEE}} Full profile in Commons wiki <i class="fas fa-arrow-right"></i>]

	[{{#external_value:BdrcLink}} BDRC Link <i class="fas fa-arrow-right"></i>]

	[{{#external_value:TolLink}} Treasury of Lives Link <i class="fas fa-arrow-right"></i>]

</div>

</div>

{{#ask: [[Category:{{PAGENAME}}]] [[Category:Tibetan texts]]
  | ?FullTitleWylie
  | ?VolumeNumber
  | ?PageNumbers
  | ?TextNumberInVolume
  | sort=VolumeNumber,TextNumberInVolume
  | order=asc,asc
  | format=template
  | template=PersonContributions
  | intro=<h2>Works by this person</h2>
  | limit=10000
}}

Pre-requisite CSS[edit]


.white-box {
	margin-bottom: 30px;
	padding: 0 30px 20px;
}

.white-box-header {
	font-size: 16px;
	font-weight: 400;
	text-align: center;
	margin-bottom: 15px;
	padding: 10px;
	border-bottom: 1px solid #ea4100;
}

.depth-2 {
	-webkit-box-shadow: 0 5px 11px 0 rgba(0, 0, 0, .18), 0 4px 15px 0 rgba(0, 0, 0, .15);
	box-shadow: 0 5px 11px 0 rgba(0, 0, 0, .18), 0 4px 15px 0 rgba(0, 0, 0, .15);
}

.reduced-margins {
	margin: 1em 0 !important;
}

.person-images img {
	height: 150px;
	width: auto;
}