Community Central

Admin Forum:Template Variables inside a Gallery


Admin Forum:Template Variables inside a Gallery

19,809pages on
this wiki
Add New Page
Talk0 Share

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


in a template page with


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.


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
and the article I'm trying to invoke it in contains this
{{Miscrit (Nature)
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:

—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