|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
krreks Smarty Rookie
Joined: 05 Feb 2007 Posts: 19
|
Posted: Sat Apr 21, 2007 2:20 pm Post subject: Language tags inside {paginate} tag |
|
|
We are using the custom function trans to translage tags into different languages. You call the function "trans" and supply is with the "id" which is the tag to be translated. The function returns the tag. The function is working properly, but we can't figure out how to call it inside a {paginate}. Normally we would have done the following to call the function like this: . We have figured out that we cant use the { braces inside the {paginate} tag. Ho can we call the function iside the tag??
Code: | {globalmenu}
{box mode="TOP" background_color="white"}
<br><br>
{* display pagination header *}
Items {$paginate.first}-{$paginate.last} out of {$paginate.total} displayed.
<br><br>
{* display results *}
{section name=res loop=$results}
{$results[res]}
{/section}
<br><br>
{* display pagination info *}
{paginate_first text="trans id=first"}
{paginate_prev text="`trans id=prev`"}
{paginate_middle format="page" prefix="" suffix="" link_prefix=" " link_suffix=" "}
{paginate_next text="`trans id=next`"}
{paginate_last text="`trans id=last`"}
<br><br>
{/box} |
|
|
Back to top |
|
toma Smarty Regular
Joined: 25 Apr 2003 Posts: 62
|
Posted: Sat Apr 21, 2007 10:16 pm Post subject: |
|
|
{trans id='whatchamacallit' assign='next'}
...
{paginate_next text=$next} |
|
Back to top |
|
krreks Smarty Rookie
Joined: 05 Feb 2007 Posts: 19
|
Posted: Sun Apr 22, 2007 4:57 am Post subject: .. |
|
|
Now I hav tried almost every single way to do it, I think....
Quote: | {trans id='whatchamacallit' assign='next'}
...
{paginate_next text=$next} |
Did not work because of the trans function returning the value..
I want to use the value returned from the function directly in the {paginate} if i assign it it will be printed to the user, which is not neccessary. Is what i want possible? |
|
Back to top |
|
toma Smarty Regular
Joined: 25 Apr 2003 Posts: 62
|
Posted: Sun Apr 22, 2007 5:30 pm Post subject: |
|
|
Your 'custom' translate function doesn't support assign of course so of course you should change it |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|