×
Namespaces

Variants
Actions
(Difference between revisions)

Template:RelatedPortals

From Nokia Developer Wiki
Jump to: navigation, search
hamishwillee (Talk | contribs)
m (Hamishwillee -)
hamishwillee (Talk | contribs)
m (Hamishwillee - Add support for WP Links through isCategory checking)
 
Line 34: Line 34:
  
 
</noinclude>{{#ifeq: {{#sub:{{{1|{{#titleparts: {{FULLPAGENAME}}|0|0}} }}}|0|7}}|Portal:|{{#ifeq: {{{debug|}}}|true|<br/>DEBUG: Do nothing because we're on a portal page<br/>|}}|{{#ifeq: {{NAMESPACE}}|Category|{{#ifeq: {{{debug|}}}|true|<br/>DEBUG: Do nothing because we're on a Category page<br/>|}}|{{#ifeq: {{{debug|}}}|true|<br/>DEBUG: Running query because we are not on Category or Portal page<br/>|}}<!--
 
</noinclude>{{#ifeq: {{#sub:{{{1|{{#titleparts: {{FULLPAGENAME}}|0|0}} }}}|0|7}}|Portal:|{{#ifeq: {{{debug|}}}|true|<br/>DEBUG: Do nothing because we're on a portal page<br/>|}}|{{#ifeq: {{NAMESPACE}}|Category|{{#ifeq: {{{debug|}}}|true|<br/>DEBUG: Do nothing because we're on a Category page<br/>|}}|{{#ifeq: {{{debug|}}}|true|<br/>DEBUG: Running query because we are not on Category or Portal page<br/>|}}<!--
-->{{#if: {{isCategory:Files/Data on Windows Phone}}{{isCategory:XML on Windows Phone}}|{{SignpostBoxWindowsPhonePortalLinkTile|title=Files/Data|link=Portal:Windows Phone Files/Data|icon=WP_Metro_Icon_File.png|colour=brown }}|<!-- is not in this category, so do nothing -->}}<!--
+
-->{{#if: {{isCategory:Files/Data on Windows Phone}}{{isCategory:XML on Windows Phone}}|{{SignpostBoxWindowsPhonePortalLinkTile|title=Files/Data|link=Portal:Windows Phone Files/Data|icon=WP_Metro_Icon_File.png|colour=brown }}{{#ifeq: {{{debug|}}}|Debug - Files/Data or XML TRUE|<!-- not debug -->}}|<!-- is not in this category, so do nothing -->}}<!--
 +
-->{{#if: {{isCategory:Games on Windows Phone}}|{{SignpostBoxWindowsPhonePortalLinkTile|title=Games|link=Portal:Windows Phone Games Articles|icon=WP_Metro_Icon_Joystick.png|colour=green}}{{#ifeq: {{{debug|}}}|Debug - Games TRUE|<!-- not debug -->}}|<!-- is not in this category, so do nothing -->}}<!--
 +
-->{{#if: {{isCategory:Maps on Windows Phone}}|{{SignpostBoxWindowsPhonePortalLinkTile|title=Maps|link=:Category:Maps on Windows Phone|icon=SignpostIcon_HereMaps_99.png|colour=orange}}{{#ifeq: {{{debug|}}}|Debug - MAPS TRUE|<!-- not debug -->}}|<!-- is not in this category, so do nothing -->}}<!--
 +
-->{{#if: {{isCategory:Messaging on Windows Phone}}|{{SignpostBoxWindowsPhonePortalLinkTile|title=Messaging|link=Portal:Windows Phone Messaging|icon=WP_Metro_Icon_Messages.png|colour=pink}}{{#ifeq: {{{debug|}}}|Debug - Messaging TRUE|<!-- not debug -->}}|<!-- is not in this category, so do nothing -->}}<!--
 +
-->{{#if: {{isCategory:Multimedia on Windows Phone}}{{isCategory:Audio on Windows Phone}}{{isCategory:Voice/Speech on Windows Phone}}{{isCategory:Video on Windows Phone}}{{isCategory:Imaging on Windows Phone}}{{isCategory:Camera on Windows Phone}}|{{SignpostBoxWindowsPhonePortalLinkTile|title=Multimedia|link=Portal:Windows Phone Multimedia|icon=WP_Metro_Icon_Multimedia.png|colour=pink}}{{#ifeq: {{{debug|}}}|Debug -Multimedia categories TRUE|<!-- not debug -->}}|<!-- is not in this category, so do nothing -->}}<!--
 +
-->{{#if: {{isCategory:Networking on Windows Phone}}|{{SignpostBoxWindowsPhonePortalLinkTile|title=Networking|link=Portal:Windows Phone Networking|icon=WP_Metro_Icon_Wifi.png|colour=red}}{{#ifeq: {{{debug|}}}|Debug - Networking TRUE|<!-- not debug -->}}|<!-- is not in this category, so do nothing -->}}<!--
 +
-->{{#if: {{isCategory:NFC on Windows Phone}}|{{SignpostBoxWindowsPhonePortalLinkTile|title=NFC|icon=WP_Metro_Icon_NFC.png|link=:Category:NFC on Windows Phone|colour=teal}}{{#ifeq: {{{debug|}}}|Debug - NFC WP - TRUE|<!-- not debug -->}}|<!-- is not in this category, so do nothing -->}}<!--
 +
-->{{#if: {{isCategory:Porting on Windows Phone}}{{isCategory:Porting Windows Phone and Qt}}|{{SignpostBoxWindowsPhonePortalLinkTile|title=Porting|width=35px|top=-1px|left=2px|link=Porting:Windows Phone Porting|icon=WP_Metro_Icon_Porting.png|colour=viridian}}{{#ifeq: {{{debug|}}}|Debug - Porting WP - TRUE|<!-- not debug -->}}|<!-- is not in this category, so do nothing -->}}<!--
 +
-->{{#if: {{isCategory:UI on Windows Phone}}{{isCategory:Animation on Windows Phone}}{{isCategory:Graphics on Windows Phone}}{{isCategory:Telerik RadControls}}{{isCategory:Windows Phone Toolkit‎}}|{{SignpostBoxWindowsPhonePortalLinkTile|title=User Interface|link=Portal:Windows Phone UI Articles|icon=WP_Metro_Icon_UI.png|colour=nokiablue }}{{#ifeq: {{{debug|}}}|Debug - UI WP - TRUE|<!-- not debug -->}}|<!-- is not in this category, so do nothing -->}}<!--
 +
-->{{#if: {{isCategory:Web Services on Windows Phone}}|{{SignpostBoxWindowsPhonePortalLinkTile|title=Web Services|link=:Category:Web Services on Windows Phone|icon=WP_Metro_Icon_Web.png|colour=nokiacyan}}{{#ifeq: {{{debug|}}}|Debug - Web Services WP - TRUE|<!-- not debug -->}}|<!-- is not in this category, so do nothing -->}}<!--
 +
-->{{#if: {{isCategory:Telephony on Windows Phone}}|{{SignpostBoxWindowsPhonePortalLinkTile|title=Telephony|link=:Category:Telephony on Windows Phone|icon=WP_Metro_Icon_MobilePhone.png|colour=nokiapurple }}{{#ifeq: {{{debug|}}}|Debug - Telephony  WP - TRUE|<!-- not debug -->}}|<!-- is not in this category, so do nothing -->}}<!--
 +
-->{{#if: {{isCategory:Testing on Windows Phone}}{{isCategory:Debugging on Windows Phone}}|{{SignpostBoxWindowsPhonePortalLinkTile|title=Test & Debug|link=Portal:Windows Phone Testing & Debugging|icon=WP_Metro_Icon_Bug.png|colour=blue}}{{#ifeq: {{{debug|}}}|Debug - Test/Debug WP - TRUE|<!-- not debug -->}}|<!-- is not in this category, so do nothing -->}}<!--
 +
-->{{#if: {{isCategory:Tools for Windows Phone}}{{isCategory:Emulator for Windows Phone}}{{isCategory:Coding4Fun Toolkit}}{{isCategory:Telerik RadControls}}{{isCategory:Windows Phone Toolkit}}|{{SignpostBoxWindowsPhonePortalLinkTile|title=Tools & SDK|link=Portal:Windows Phone Tools & SDK|icon=WP_Metro_Icon_Tools.png|colour=brown }}{{#ifeq: {{{debug|}}}|Debug - Tools WP - TRUE|<!-- not debug -->}}|<!-- is not in this category, so do nothing -->}}<!--
 +
-->{{#if: {{isCategory:Optimization on Windows Phone}}|{{SignpostBoxWindowsPhonePortalLinkTile|title=Optimisation |link=:Category:Optimization on Windows Phone|icon=WP_Metro_Icon_Graph1.png|colour=lime}}{{#ifeq: {{{debug|}}}|Debug - Optimization WP - TRUE|<!-- not debug -->}}|<!-- is not in this category, so do nothing -->}}<!--
 +
-->{{#if: {{isCategory:XAML}}|{{SignpostBoxWindowsPhonePortalLinkTile|link=:Category:XAML|left=1px|top=-2px|width=40px|icon=SignpostIcon_XAML_40.png|colour=nokiapurple }}{{#ifeq: {{{debug|}}}|Debug - XAML WP - TRUE|<!-- not debug -->}}|<!-- is not in this category, so do nothing -->}}<!--
 +
-->{{#if: {{isCategory:XNA}}|{{SignpostBoxWindowsPhonePortalLinkTile|title=XNA|link=:Category:XNA|icon=WP_Metro_Icon_XNA.png|colour=orange}}{{#ifeq: {{{debug|}}}|Debug - XNA WP - TRUE|<!-- not debug -->}}|<!-- is not in this category, so do nothing -->}}<!--
 +
-->{{#if: {{isCategory:DirectX}}|{{SignpostBoxWindowsPhonePortalLinkTile|title=DirectX|link=:Category:DirectX|icon=WP_Metro_Icon_DirectX.png|colour=blue }}{{#ifeq: {{{debug|}}}|Debug - DirectX WP - TRUE|<!-- not debug -->}}|<!-- is not in this category, so do nothing -->}}<!--
 +
-->{{#if: {{isCategory:Windows Phone 8}}|{{SignpostBoxWindowsPhonePortalLinkTile|link=:Category:Windows Phone 8|icon=WP_Metro_Icon_WP8.png|colour=nokiablue}}{{#ifeq: {{{debug|}}}|Debug - DirectX WP - TRUE|<!-- not debug -->}}|<!-- is not in this category, so do nothing -->}}<!--
 +
-->{{#if: {{isCategory:Windows Phone 7.5}}|{{SignpostBoxWindowsPhonePortalLinkTile|link=:Category:Windows Phone 7.5|icon=SignpostIcon_WP7_70px.png|colour=nokiablue}}{{#ifeq: {{{debug|}}}|Debug - DirectX WP - TRUE|<!-- not debug -->}}|<!-- is not in this category, so do nothing -->}}<!--
 +
-->{{#if: {{isCategory:Getting Started on Windows Phone}}|{{SignpostBoxWindowsPhonePortalLinkTile|title=Getting Started|link=:Category:Getting Started on Windows Phone|icon=WP_Metro_Icon_Baby.png|colour=magenta}}{{#ifeq: {{{debug|}}}|Debug - Getting started WP - TRUE|<!-- not debug -->}}|<!-- is not in this category, so do nothing -->}}<!--
 +
-->{{#if: {{isCategory:General Programming on Windows Phone}}|{{SignpostBoxWindowsPhonePortalLinkTile|title=General Prog.|width=52px|top=-5px|left=-5px|link=Portal:Windows Phone General Programming|icon=SignpostIcon_Code_52.png|colour=lime}}{{#ifeq: {{{debug|}}}|Debug - General programming WP - TRUE|<!-- not debug -->}}|<!-- is not in this category, so do nothing -->}}<!--
 
-->{{#dpl:
 
-->{{#dpl:
 
|namespace=¦Category
 
|namespace=¦Category

Latest revision as of 09:27, 4 July 2013

This template lists portal pages which link against the current (or specified) page. It is an experimental template for determining if we can get better "related topic" matching than is provided by categories.

Internal use only.

This template uses Template:AddPortalIcon.dpl.default to define the mapping between portal title and icon. Need this because the parserfunction does not seem to be expanded within DPL.


Contents

[edit] Usage

{{RelatedPortals|Target page name}}

The parameters are:

  • (optional) The first unnamed parameter is the name of the target page. If not specified, this defaults to the current page.
  • debug: (optional) Forces some debug output.
  • notcategory: (optional) Specify a category like veryunlikelycategory1 to force a refresh.

[edit] Examples

{{RelatedPortals|How to get IMEI in Java ME}}


DEBUG: Running query because we are not on Category or Portal page
DEBUG - NO RESULTS

  • first unnamed parameter (title): How to get IMEI in Java ME
  • Full page name: Template:RelatedPortals
  • titleparts full page name: Template:RelatedPortals
  • Links to: How to get IMEI in Java ME
  • Namespace - note only reliable on actual page (is namespace of current page not of specified page) Template


[edit] Tiles defined here

WP Metro Icon File.png


[edit] Appearance

Default use on this page (should be "nothing")


This page was last modified on 4 July 2013, at 09:27.
309 page views in the last 30 days.
×