Transcluding People Pages on Other Wikis

From Tsadra Commons
Revision as of 13:02, 1 February 2018 by Jeremi (talk | contribs) ((by SublimeText.Mediawiker))

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=[[{{{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;">
	{{#if:{{#external_value:Images}}|
		{{#tag:gallery
			|{{#external_value:Images}}
			|mode="slideshow"
			|heights=500px
			|class="reduced-margins"
		}}
	|}}
</div>

<span style="font-size: x-large;">{{#external_value:MainNameTib}}</span>

</div>

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;
}