Wikia

Community Central

Admin Forum:Template Variables inside a Gallery

18,698pages on
this wiki
Talk0

This Forum has been archived

Forums: Admin Central Index Technical Help Template Variables inside a Gallery
Wikia's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.


Is it possible to use templates to put images into a gallery?  I've tried using something to the effect of

<gallery>
{{{image1|}}}
{{{image2|}}}
</gallery>

in a template page with

|image1=image1name.png
|image2=image2name.png

in the article as well as several variations of this, but the gallery doesn't show up. I know the template itself is fine because everything else is working properly. The template is here and the page I'm testing it on is here if that helps.

Thanks!

NconspicuousTALK 04:19, January 19, 2013 (UTC)

I'm confused, are you trying to use templates in the gallery or template variables? Templates are invoked like this: {{template|optional params}} whereas template variables are used like this: {{{varname|optional default}}}.
Notice the different counts of curly braces (templates 2, variables 3). Your code looks like you have things reversed. -- Fandyllic (talk · contr) 19 Jan 2013 11:25 AM Pacific
Yes this would work Cblair91 Talk
19:39, January 19, 2013 (UTC)
Sorry if I wasn't clear, what I meant was that the template page (Template:Miscrit (Nature)) contains
<gallery>
{{{image1|}}}
{{{image2|}}}
</gallery>
and the article I'm trying to invoke it in contains this
{{Miscrit (Nature)
|image1=image1name.png
|image2=image2name.png
}}
So I'm trying to use the template variables in the gallery.  I don't see any reason why it shouldn't work, but it isn't.
NconspicuousTALK 19:57, January 19, 2013 (UTC)

I still can't get it to work, so any thoughts would be appreciated.  It seems that the gallery is treating the variable as an empty line rather than the value it is supposed to represent, but I don't know how to get around this.

NconspicuousTALK 19:48, January 20, 2013 (UTC)

Solved.  The code that I needed in the template page was this:
{{#tag:gallery|
{{{pic1|}}}
{{{pic2|}}}
{{{pic3|}}}
{{{pic4|}}}
|type="slideshow"
|hideaddbutton=true
|crop="true"
}}

—This unsigned comment is by Nconspicuous (talkcontribs) 16:46, January 20, 2013‎. Please sign your posts with ~~~~!


Cool. -- Fandyllic (talk · contr) 21 Jan 2013 10:10 AM Pacific

Around Wikia's network

Random Wiki