Fórum

Basic design question - How to do it in LifeRay

John Gerdes, modificado 12 Anos atrás.

Basic design question - How to do it in LifeRay

New Member Postagens: 10 Data de Entrada: 24/05/11 Postagens Recentes
I have two questions
1) I am trying to create a basic 3 x 2 design, with a static header, static footer, and the center having navigation on the left and content on the right. Pretty basic. Conceptually, I thought I could code the header and footer in html/css, and then just place the liferay 'content' div section in the center row so that all the portlets would fall in the center section. Basically I am just wrapping a skin around the liferay page.

Is this the best way of doing this? If not, any pointers would be appreciated.

2) Also, how do I reference an image in the template or css? I tried both "images/mypic.png" and "../images/mypic.png", but I am having trouble.
thumbnail
Hitoshi Ozawa, modificado 12 Anos atrás.

RE: Basic design question - How to do it in LifeRay

Liferay Legend Postagens: 7942 Data de Entrada: 24/03/10 Postagens Recentes
Personally, I don't like to write too many programs so I'll just create a site template and place web content portlets in header and footer and may be some kind of navigation portlet on the left side.
John Gerdes, modificado 12 Anos atrás.

RE: Basic design question - How to do it in LifeRay

New Member Postagens: 10 Data de Entrada: 24/05/11 Postagens Recentes
Doing some further investigation I saw that having my theme.parent in build.xml based on "_styled" instead of "classic" is likely the cause of my problems. I will post back if that appears to address my problem.

Also, it appears I should use "../images/mypic.png" to reference images.
thumbnail
José Manuel Domínguez Romero, modificado 12 Anos atrás.

RE: Basic design question - How to do it in LifeRay

Regular Member Postagens: 219 Data de Entrada: 03/02/10 Postagens Recentes
Hi John,

The init.vm file contains the variables that can be used in the themes' templates. In the file VelocityVariables.java you can create your own variables for the templates.

But in your case:

$css_folder
$images_folder
$javascript_folder
$templates_folder
$full_css_path
$full_templates_path


i.e:
$images_folder/mypic.png


Regards
John Gerdes, modificado 12 Anos atrás.

RE: Basic design question - How to do it in LifeRay

New Member Postagens: 10 Data de Entrada: 24/05/11 Postagens Recentes
Thanks Jose,

Apparently the Init.vm file was used in previous versions, but not in 6.0, although there still is a copy of it in the _unstyled / templates directory of the classic theme. When I created my new them (using Classic) the init.vm file was not placed in my templates directory, so I am not sure it is being used or if the variables are being set. (I am not sure how to display the contents of these system variables).

I am still struggling with this issue (specifying images locations). I tried using $images_folder/mypic.png, but I am still not seeing the images. I don't even see the missing image placeholder you normally see for missing images when viewing html documents.

I will be doing a little trial and error to see if I can get it working. Any additional hints would be appreciated.

Best,

John
thumbnail
José Manuel Domínguez Romero, modificado 12 Anos atrás.

RE: Basic design question - How to do it in LifeRay (Resposta)

Regular Member Postagens: 219 Data de Entrada: 03/02/10 Postagens Recentes
Hi John,

It's strange, but ok. Try to check these points:

- You have a _diffs folder.
- Into _diffs folder you have a templates folder.
- Into _templates folder you have a portal_normal.vm.

Now, edit portal_normal.vm and add the following:

<footer id="footer" role="contentinfo">
	<p class="powered-by">
		#language("powered-by") <a href="http://www.liferay.com" rel="external">Liferay</a>
		[color=#0010ff][b]</p><div>$images_folder</div>[/b][/color]
	<p></p>
</footer>


If you want to show the content of a velocity variable, write this: $variable_name.

$images_folder return the path of the image folder in your theme, so you should see something like this: /nameofnewtheme/images. Test if your images are in this folder: if not, copy the images you need here.

If it does not appear at all or goes out $images_folder directly, the variables aren't being set. Add the init_custom.vm in your templates folder and copy the content of the init.vm into init_custom.vm.

The point is to be sure that you have access to the variables of velocity and that it appears on having called the variables that you need.

Certainly, sorry for my low level of English's knowledge.
John Gerdes, modificado 12 Anos atrás.

RE: Basic design question - How to do it in LifeRay

New Member Postagens: 10 Data de Entrada: 24/05/11 Postagens Recentes
This worked great. Thank you for clarifying how this all goes together.
Sanjay Sharma, modificado 11 Anos atrás.

RE: Basic design question - How to do it in LifeRay

New Member Postagens: 6 Data de Entrada: 12/10/12 Postagens Recentes
Thanks for this information..its very helpful for me