Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Language tags inside {paginate} tag

 
Post new topic   Reply to topic    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
krreks
Smarty Rookie


Joined: 05 Feb 2007
Posts: 19

PostPosted: Sat Apr 21, 2007 2:20 pm    Post subject: Language tags inside {paginate} tag Reply with quote

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:
Code:
{trans id=prev}
. 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
View user's profile Send private message
toma
Smarty Regular


Joined: 25 Apr 2003
Posts: 62

PostPosted: Sat Apr 21, 2007 10:16 pm    Post subject: Reply with quote

{trans id='whatchamacallit' assign='next'}
...
{paginate_next text=$next}
Back to top
View user's profile Send private message Visit poster's website
krreks
Smarty Rookie


Joined: 05 Feb 2007
Posts: 19

PostPosted: Sun Apr 22, 2007 4:57 am    Post subject: .. Reply with quote

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
View user's profile Send private message
toma
Smarty Regular


Joined: 25 Apr 2003
Posts: 62

PostPosted: Sun Apr 22, 2007 5:30 pm    Post subject: Reply with quote

Your 'custom' translate function doesn't support assign of course so of course you should change it
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP