Utkast:IW Redirect
Från Rilpedia
(Skillnad mellan versioner)
Rad 1: | Rad 1: | ||
{{redirect.locator|basepage=Main_Page|locator=Default}} | {{redirect.locator|basepage=Main_Page|locator=Default}} | ||
+ | |||
+ | |||
+ | {{text|> #REDIRECT [[iw-code:BlahBlah/{{template.default.locator}}]] | ||
+ | > | ||
+ | > Unfortunately the above redirect doesn't work. | ||
+ | |||
+ | Did you try go the other way around and including the redirect statement inside the template instead, like so: | ||
+ | |||
+ | {{redirect.locator.default}} | ||
+ | |||
+ | ...which containing the code: | ||
+ | |||
+ | #REDIRECT:[[iw-code:BlahBlah/YourDefaultLocator]] | ||
+ | |||
+ | Then you could use an optional parameter ("locator" in this case), like | ||
+ | |||
+ | {{redirect.locator|locator=AnotherLocator}} | ||
+ | |||
+ | ...which will be used if it is set. Otherwise the default one is used. | ||
+ | One could also have the basepage as a parameter: | ||
+ | |||
+ | {{redirect.locator|basepage=iw-code:BlaBlah|locator=AnotherLocator}} | ||
+ | |||
+ | and then, inside the template have something like: | ||
+ | |||
+ | #REDIRECT:[[{{#ifeq: {{{basepage| }}} | | | {{{basepage}}}/ }}{{#ifeq: {{{locator| }}} | | Main_Page | {{{locator}}} }}]] | ||
+ | |||
+ | (Didn't have the time to check up }} |
Nuvarande version från 23 maj 2007 kl. 13.01
- REDIRECT:Main_Page/Default