Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
John Gerdes
Basic design question - How to do it in LifeRay
May 25, 2011 4:46 PM
Answer

John Gerdes

Rank: New Member

Posts: 11

Join Date: May 24, 2011

Recent Posts

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.
Hitoshi Ozawa
RE: Basic design question - How to do it in LifeRay
May 25, 2011 5:47 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

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
RE: Basic design question - How to do it in LifeRay
May 25, 2011 7:19 PM
Answer

John Gerdes

Rank: New Member

Posts: 11

Join Date: May 24, 2011

Recent Posts

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.
José Manuel Domínguez Romero
RE: Basic design question - How to do it in LifeRay
May 26, 2011 2:22 AM
Answer

José Manuel Domínguez Romero

Rank: Regular Member

Posts: 219

Join Date: February 3, 2010

Recent Posts

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:
1$images_folder/mypic.png


Regards
John Gerdes
RE: Basic design question - How to do it in LifeRay
May 31, 2011 6:19 AM
Answer

John Gerdes

Rank: New Member

Posts: 11

Join Date: May 24, 2011

Recent Posts

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
José Manuel Domínguez Romero
RE: Basic design question - How to do it in LifeRay
June 1, 2011 2:55 AM
Answer

José Manuel Domínguez Romero

Rank: Regular Member

Posts: 219

Join Date: February 3, 2010

Recent Posts

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:

1<footer id="footer" role="contentinfo">
2    <p class="powered-by">
3        #language("powered-by") <a href="http://www.liferay.com" rel="external">Liferay</a>
4        [color=#0010ff][b]<div>$images_folder</div>[/b][/color]
5    </p>
6</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
RE: Basic design question - How to do it in LifeRay
June 1, 2011 9:04 AM
Answer

John Gerdes

Rank: New Member

Posts: 11

Join Date: May 24, 2011

Recent Posts

This worked great. Thank you for clarifying how this all goes together.
Sanjay Sharma
RE: Basic design question - How to do it in LifeRay
October 12, 2012 2:25 AM
Answer

Sanjay Sharma

Rank: New Member

Posts: 6

Join Date: October 12, 2012

Recent Posts

Thanks for this information..its very helpful for me