Templates: Transcluding a redirect
63,505pages on
this wiki
this wiki
Forum page
Forums: Index → Support Requests → Templates: Transcluding a redirect
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.
To contact staff directly or to report bugs, please use Special:Contact.
Note: This topic has been unedited for 694 days. It is considered archived - the discussion is over. Do not add to unless it really needs a response.
On the Programmer's Wiki, we have a glossary, sections of which several pages redirect to. I was hoping to make these redirects more manageable by abstracting them into a temp[ate which would be transcluded onto them. Unfortunately, as the template code contains a redirect, the glossary itself is transcluded rather than a redirect, and the section within it is not scrolled to. I tried using the ASCII codepoint # in place of the #, but this prevents MediaWiki from honoring the redirect at all. Is there any way to make this work?
Thanks! --Jesdisciple (talk) 05:48, June 24, 2010 (UTC)
- I think it would be easier to make each glossary entry a separate page (maybe a subpage) and transclude them all together in the glossary and then individually wherever you want them to appear. The trick is to make sure each entry has an edit link somewhere unobtrusive, so people can still easily update the entries. You don't need to put pages in the Template: namespace to transclude them. For non-Template: namespace pages, use
{{:pagename}}to transclude them. Make sure to use<onlyinclude></onlyinclude>around portions of pages you want to transclude. -- Fandyllic (talk · contr) 8:37 AM PST 24 Jun 2010
- I have been considering that, but I do like having each term nested within all the others no matter how the reader arrives at it. The problem (and I don't think transcluded entries fix this) is that if we decide to change an entry's title then we have to track down OOP, Object-Oriented_Programming, Object-oriented_programming, and any other page titles we thought fit. A template would be able to mark each page with [[Category:Glossary redirects for <entryname>]] (with a bot creating those category pages). Or Semantic MediaWiki might have a sleeker solution... I haven't looked into that yet. (Sorry folks, my siggy broke for some reason... I'm Jesdisciple. =P) --Jesdisciple (talk) 15:02, 25 June 2010 (UTC)
- I haven't tested this but try putting just the destination section in the template, so on the individual term page you would have e.g.,
#REDIRECT [[Glossary#{{TermListTemplate|OOP}}]] - Again, don't know if it will work, if not there is a way to make this work without redirects. You would need a template (called Template:GlossaryEntry in this example) which would look like:
{{#ifeq:{{{1}}}|{{{2}}}|{{{3}}}}}
- Then on the glossary page you would need to do something like:
==Section 1==
<onlyinclude>{{GlossaryEntry|{{{1|Term}}}|Term|Term definition blah blah}}</onlyinclude>
==Section 2==
<onlyinclude>{{GlossaryEntry|{{{1|Another term}}}|Another term|Another term definition blah blah}}</onlyinclude>
- Then on the calling page you would put:
{{:Glossary|Term}}
- or
{{:Glossary|Another term}}
- Cool, I didn't know LabeledSectionTransclusion was one of the standard extensions now. Jesdisciple, check Special:Version and if it lists LabeledSectionTransclusion, Pcj's stuff should work. -- Fandyllic (talk · contr) 11:22 AM PST 25 Jun 2010
- Woops, sorry I forgot to respond. Pcj's first solution doesn't work, so I'll have to get to work converting the glossary for the second. LabeledSectionTransclusion isn't on my wiki, but if I hadn't recently requested an extension that's not in w:c:help:Category:Extensions enabled on request I would ask that it be added. Apparently Wikia has to import each extension into SVN, so I don't feel comfortable asking for another extra one. --Jesdisciple (talk) 12:50, June 29, 2010 (UTC)