You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Elad Messing <El...@sphera.com> on 2004/01/20 15:14:54 UTC

Embeding dynamic contect into HTML tags

Hi
	Another newbie question :). I am porting my application from PHP
- so I need some re-education ....

	I have a long body tag. 90% of it is static - so I don't think I
need to use the "body" component of Tapestry. BUT - the background of
the image is brandable - each user can use its own image. The image sits
in a special directory for each user. So - the property look something
like :  ' background="%val_user_branding_dir%images/BG_with_logo.gif" '.
In PHP I used to replace this property all over the page  - whenever the
string %val_user_branding_dir% was written.

	Now in Tapestry.... My question Is 2 parted :
	1. How to store a global variable for a PER SESSION (per user)
scope - like the user own branding directory.
	2. How to use this variable in HTML tags - like the "body" and
others - without building a tapestry component around each one.

Elad Messing

Sphera Tech. LTD
 <<Picture (Metafile)>> 
<http://www.sphera.com/demosite/index.htm>



Re: Embeding dynamic contect into HTML tags

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jan 20, 2004, at 9:14 AM, Elad Messing wrote:
>         I have a long body tag. 90% of it is static - so I don’t think 
> I need to use the "body" component of Tapestry. BUT - the background 
> of the image is brandable - each user can use its own image. The image 
> sits in a special directory for each user. So - the property look 
> something like :  ' 
> background="%val_user_branding_dir%images/BG_with_logo.gif" '. In PHP 
> I used to replace this property all over the page  - whenever the 
> string %val_user_branding_dir% was written.

I recommend you use the Body and Shell components so that a lot of 
plumbing is taken care of for you.

>         1. How to store a global variable for a PER SESSION (per user) 
> scope - like the user own branding directory.

You can use the Visit object to do this.

>         2. How to use this variable in HTML tags - like the "body" and 
> others - without building a tapestry component around each one.

You can refer to the Visit object in OGNL expressions using 
"visit.<...>" syntax.

>
> Elad Messing
>
> Sphera Tech. LTD
>
> <image.tiff>

Please don't send HTML formatted e-mail to lists.

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org