You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Kintzel Levente <ki...@codespring.ro> on 2006/08/31 15:40:28 UTC
Layout context variable
Hi guys!
I want to set the title of my web pages dynamically, read from a property
file according to the current locale. How can I set the value of the title
context variable in such a way to be recognized by the layout template:
- I tried to set it up from the screen: it works fine, but I don't want to
upload the value of the variable in each screen.
- I tried to set it up from a navigation: it was not recognized
- I tried to save in the session, but I have trouble if the session expires.
Has anybody another idea?
Thank you!
Regards,
Levi
RE: Layout context variable
Posted by Declan Shanaghy <tu...@shanaghy.com>.
Never mind me, I misunderstood the problem till I saw Tony's reply
-----Original Message-----
From: Declan Shanaghy [mailto:turbine@shanaghy.com]
Sent: Friday, September 08, 2006 9:13 AM
To: 'Turbine Users List'
Subject: RE: Layout context variable
How about if u create a base screen class?
e.g.
public abstract class MyBaseScreen extends VelocityScreen {
public void doPerform(...)
{
//set title
}
}
public class EndUserScreen extends MyBaseScreen {
public void doPerform(...)
{
super.doPerform(...)
//do whatever else
}
}
-----Original Message-----
From: Kintzel Levente [mailto:kintzel.levente@codespring.ro]
Sent: Thursday, August 31, 2006 6:40 AM
To: Turbine Users List
Subject: Layout context variable
Hi guys!
I want to set the title of my web pages dynamically, read from a property
file according to the current locale. How can I set the value of the title
context variable in such a way to be recognized by the layout template:
- I tried to set it up from the screen: it works fine, but I don't want to
upload the value of the variable in each screen.
- I tried to set it up from a navigation: it was not recognized
- I tried to save in the session, but I have trouble if the session expires.
Has anybody another idea?
Thank you!
Regards,
Levi
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org
RE: Layout context variable
Posted by Declan Shanaghy <tu...@shanaghy.com>.
How about if u create a base screen class?
e.g.
public abstract class MyBaseScreen extends VelocityScreen
{
public void doPerform(...)
{
//set title
}
}
public class EndUserScreen extends MyBaseScreen
{
public void doPerform(...)
{
super.doPerform(...)
//do whatever else
}
}
-----Original Message-----
From: Kintzel Levente [mailto:kintzel.levente@codespring.ro]
Sent: Thursday, August 31, 2006 6:40 AM
To: Turbine Users List
Subject: Layout context variable
Hi guys!
I want to set the title of my web pages dynamically, read from a property
file according to the current locale. How can I set the value of the title
context variable in such a way to be recognized by the layout template:
- I tried to set it up from the screen: it works fine, but I don't want to
upload the value of the variable in each screen.
- I tried to set it up from a navigation: it was not recognized
- I tried to save in the session, but I have trouble if the session expires.
Has anybody another idea?
Thank you!
Regards,
Levi
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org
RE: Layout context variable
Posted by Tony Oslund <to...@lifeinnovations.com>.
Hello Levi,
I solved this problem by appending some parameters onto the end of the
url.
When the session times out it does not matter because the next request
always has the necessary locale information within the url itself.
To make this work I created my own linkage routines which include the
necessary information on every page.
We simply put my linkage routines within a custom tool that I created
that is always available within the templates. I use this instead of
the standard linkage tool.
I also use this for re-skinning, tracking affiliates, language control,
etc. Our product is plugged into multiple affiliate web sites. Each
site might want a different look, language, etc. If you would like to
see a basic example of what I am talking about take a look at the
following sites.
Notice that there are simply common parameters with slightly different
values. If you watch the url as you move between pages you will notice
that these parameters are re-propagated within each url.
https://www.couplecheckup.com/webapp/partner/inventory/create_account/te
mplate/CoupleCheckupSplash.vm?orig_id=LTL&lang_code=ENGLISH_STYLE1
https://www.couplecheckup.com/webapp/partner/inventory/create_account/te
mplate/CoupleCheckupSplash.vm?orig_id=ARP&lang_code=ARP_ENGLISH
Also, I had looked into simply embedding a hidden field within my
layouts but that only works if you are doing a form submittal.
It is possible that there is something pre-existing within Turbine that
allows this behavior. I had a lot of reasons for creating the framework
that I built on top of Turbine, and this was just an off shoot of that.
Tony
-----Original Message-----
From: Kintzel Levente [mailto:kintzel.levente@codespring.ro]
Sent: Thursday, August 31, 2006 8:40 AM
To: Turbine Users List
Subject: Layout context variable
Hi guys!
I want to set the title of my web pages dynamically, read from a
property
file according to the current locale. How can I set the value of the
title
context variable in such a way to be recognized by the layout template:
- I tried to set it up from the screen: it works fine, but I don't want
to
upload the value of the variable in each screen.
- I tried to set it up from a navigation: it was not recognized
- I tried to save in the session, but I have trouble if the session
expires.
Has anybody another idea?
Thank you!
Regards,
Levi
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org