论坛

主页 » Liferay Portal » English » 3. Development

组合视图 统一视图 树状图
讨论主题 [ 上一个 | 下一个 ]
toggle
Michael Poznecki
[SOLVED] Passing in variables into theme
2009年7月29日 上午6:30
答复

Michael Poznecki

等级: Expert

帖子: 301

加入日期: 2008年12月10日

最近的帖子

Hello,
I have created a new theme. How can I dynamically pass in some values? Depending on what a user chooses in a dropdown listbox, I want to display some information in a <div> in the theme.

Does that make sense?

Thanks,
Michael
Mika Koivisto
RE: Passing in variables into theme
2009年5月7日 上午6:26
答复

Mika Koivisto

等级: Liferay Legend

帖子: 1515

加入日期: 2006年8月7日

最近的帖子

Theme can access the request and thus any query parameter given to the page.
Shahzad . Hussain
RE: Passing in variables into theme
2009年5月7日 下午9:54
答复

Shahzad . Hussain

等级: Junior Member

帖子: 52

加入日期: 2008年5月26日

最近的帖子

Hi Mika Koivisto could u plz explain in more details...............
David Truong
RE: Passing in variables into theme
2009年5月8日 上午12:34
答复

David Truong

LIFERAY STAFF

等级: Expert

帖子: 314

加入日期: 2005年3月23日

最近的帖子

Mika is saying $request will give you access to the request... thus you can do $request.getParameter("parameter")

Note that the parameter will not be namespaced so you should make sure that you don't namespace it also in your form.

You can also insert values by sticking into the velocity context. Check out VelocityVariables
Michael Poznecki
RE: Passing in variables into theme
2009年5月22日 上午9:17
答复

Michael Poznecki

等级: Expert

帖子: 301

加入日期: 2008年12月10日

最近的帖子

Thanks guys. The Velocity Variables worked. I found a couple of examples on the web.

http://issues.liferay.com/browse/LEP-1308

and

http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Custom+Velocity+Variables
Michael Poznecki
RE: Passing in variables into theme
2009年6月1日 上午11:57
答复

Michael Poznecki

等级: Expert

帖子: 301

加入日期: 2008年12月10日

最近的帖子

Ok,
so I would like to create a new array of information that can be access at any time while the user is logged in. I don't think that this can go into a velocity variable, so what can I use?

Thanks,
Michael
atul patel
Re: [Liferay Forums][3. Development] RE: Passing in variables into theme
2009年6月1日 下午1:23
答复

atul patel

等级: Regular Member

帖子: 192

加入日期: 2006年11月17日

最近的帖子

Can you tell us more by what it needs to be accessed by? Portlets or
themes?

Atul Patel
+1-310-880-3574

On Jun 1, 2009, at 11:57 AM, "Michael Poznecki from liferay.com" <no-reply@liferay.com
> wrote:

> Ok,
> so I would like to create a new array of information that can be
> access at any time while the user is logged in. I don't think that
> this can go into a velocity variable, so what can I use?
>
> Thanks,
> Michael
> --
> Liferay Message Boards
> http://www.liferay.com/web/guest/community/forums/-/message_boards/message/3224470
> mb.239390.3224470@events.liferay.com
> http://www.liferay.com
Michael Poznecki
RE: Re: [Liferay Forums][3. Development] RE: Passing in variables into them
2009年6月2日 上午4:34
答复

Michael Poznecki

等级: Expert

帖子: 301

加入日期: 2008年12月10日

最近的帖子

I need to be able to access my array at any time. Basically it is additional user information. I can take the array and get what I need out of it to put into a velocity variable, so in practice I really don't need to access the array from a theme.
David Truong
RE: Re: [Liferay Forums][3. Development] RE: Passing in variables into them
2010年4月6日 下午11:47
答复

David Truong

LIFERAY STAFF

等级: Expert

帖子: 314

加入日期: 2005年3月23日

最近的帖子

Just store it in the session and ignore putting it in the velocity context. I say that just in case you need to grab it from portlets.