Thread
Forum » The Community / How may we help you? » Include with variable acting strange
Started by: Steven Heynderickx Steven Heynderickx
Date: 18 Apr 2012 08:17
Number of posts: 5
rss icon RSS: New posts
Include with variable acting strange

If you want to know what I use it for to suggest me a better solution, I will explain it but it's a long story… a complex work-around for wish 780. But this is the problem I have:

on a certain page I call an include-function with a variable named X
[[include listparts x=%%name%%]] and as you can see it is the name of the containing page

on the page listparts is the following code

Passed on name = {$x}
[[module listpages link_to="." type="*" category="3"]]
Passed on name in LP = {$x}
[[span class="part{$x}"]]%%form_raw{part1}%%[[/span]]
[[/module]]

This code renders two different value's for {$x}, the one outside the listpages = correct and the one inside the listpages= always 1

I can't imagen that the default value of an unknown variable is 1 so… where does the 1 come from?


A - S I M P L E - P L A N by ARTiZEN a startingpoint for simple wikidot solutions.

Last edited on 18 Apr 2012 08:18 by Steven Heynderickx
by Steven Heynderickx Steven Heynderickx , 18 Apr 2012 08:17
Re: Include with variable acting strange
Timothy Foster Timothy Foster 18 Apr 2012 12:07

The 1 is probably the first page that the ListPages module is selecting.

As for how to amend this, I'm really not sure. This problem seems related to one of the original bugs, so I'm not sure how to solve this. The last time I ran into this problem, I had to use an army of iframes.


Timothy Foster - @tfAuroratide
Auroratide.com - Go here if you're nerdy like me

by Timothy Foster Timothy Foster , 18 Apr 2012 12:07
Re: Include with variable acting strange

Thanks Timothy! Did you also see my wish http://feedback.wikidot.com/wish:780? What do you think of it?


A - S I M P L E - P L A N by ARTiZEN a startingpoint for simple wikidot solutions.

by Steven Heynderickx Steven Heynderickx , 18 Apr 2012 12:28
Re: Include with variable acting strange
Timothy Foster Timothy Foster 18 Apr 2012 20:57

Yes, I can see where you are going with that. You seem to have a pickle unless you flip your pages to the _default category and use tags to emulate pseudo-categories instead. The wish would solve your issue, but it seems inconsistent with the form-data variable behavior. The implementation may be tougher than you surmise, but I'm not one of the developers, so I don't know.

I did rate it up though since added functionality would do more good than harm :)


Timothy Foster - @tfAuroratide
Auroratide.com - Go here if you're nerdy like me

Last edited on 18 Apr 2012 20:58 by Timothy Foster
by Timothy Foster Timothy Foster , 18 Apr 2012 20:57
Re: Include with variable acting strange

Thanks!


A - S I M P L E - P L A N by ARTiZEN a startingpoint for simple wikidot solutions.

by Steven Heynderickx Steven Heynderickx , 19 Apr 2012 10:50
/forum/t-462190/include-with-variable-acting-strange#post-