Right template

    Keywords: SL description

<template>=>{{{1}}}</template>

See also: Left Template

Purpose

Herman: I made this template because there is no way to check for the value of template parameters.

On the picture template, if you want to have a caption (or author/license), then you want it under the image. But that requires knowing where the image is (ie, the value of the "align" parameter), which is impossible. So I created this, which allowed me to do:

{{{{{align}}}|{{{caption}}}}}

Which aligns the caption the right way, because {{{align}}} is replaced with (for example) "right", and {{{caption}}} with the caption text, so the above results in:

{{right|caption text}}

Which then inlines this template, and does what I want.

I don't know a better way to do this right now, if anyone has a solution that is less ugly, please let me know.


This is a copy of the living page "Right template" at Sensei's Library.
(OC) 2014 the Authors, published under the OpenContent License V1.0.
[Welcome to Sensei's Library!]
StartingPoints
ReferenceSection
About