That works, I have been trying it, because $view_parameters array is available within the template. but I really need to pass the values without filling the URI. in my case, I might have maybe 3 or 4 includes of that pager.tpl on the same page which need different parameters in each include. That would lead to extremely long and awkward URIs if I had to pass them all through the URI.
I really need to understand why parameter foo isn't passed to the templade via the include statement; maybe I am getting something wrong, but I can't find what. I have been browsing at google.tpl code, and I seem to pass/handle the parameters in the same way ... so I am rather puzzled.
I am not sure I understood you correctly. but no, the template does no attribute/node_view_gui within it. it is just plain HTML code output, switched and cycled through depending on the passed parameters.
in classifiche.tpl (a template of my custom extension, invoked from url www.mysite.com/wt/classifiche)
first lines of footer.tpl (for debugging purposes):
<h1>{$foo|attribute(show)}</h1>
<hr/>
<h1>{$:foo|attribute(show)}</h1>
both lines show me the familiar "Attribute Type Value" line, but no content under it.
I don't get the error "Unknown template variable 'foo' in namespace '' " now (I don't know why I don't get the error now), but no content / value passing yet.
The |attribute(show) is only useful if performed on an object or an array.
The example you posted declares $myFoo as the string <i>HELLO!</i>. Doing an attribute(show) on a simple type (boolean, string, int, float,...) only returns the "Attribute Type Value" line. If you want to see what's in those variables, you only need to print them, e.g. {$:foo}
of course you're right! I think I have spent too much time in front of the pc today .. :)
I rerun the test, and I get a HELLO! for both $foo and $:foo .
So I am "happy". the quotation marks are due to the fact that I do not know why the "unknown variable" error disappeared by itself, so I cannot say I "grasped" it.
Still, thanks for your valuable help. Tomorrow I'll clean up the code and finally finish implementing the pager :)
You must be logged in to post messages in this topic!