Forums

Home » Liferay Portal » English » 2. Using Liferay » General

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Katarzyna B
How to change logo's link
July 19, 2012 1:42 PM
Answer

Katarzyna B

Rank: New Member

Posts: 18

Join Date: January 7, 2012

Recent Posts

Hi,

I'd like to change the URL that community logo (in banner) links to. Right now, on every community it links to Liferay portal's main page.
Any hints how can I do it?

Thanks!
Katarzyna
Shinn Lok
RE: How to change logo's link
July 19, 2012 2:01 PM
Answer

Shinn Lok

LIFERAY STAFF

Rank: Junior Member

Posts: 63

Join Date: January 14, 2011

Recent Posts

By default, the logo links to the site's default url. You can change this in portal_normal.vm of your theme.

1<a class="$logo_css_class" href="[color=#ff0000]$CHANGE THIS$[/color]" title="#language("go-to") $site_name">
2    <img alt="$logo_description" height="$site_logo_height" src="$site_logo" width="$site_logo_width" />
3</a>
Hitoshi Ozawa
RE: How to change logo's link
July 19, 2012 3:03 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7990

Join Date: March 23, 2010

Recent Posts

By default, the logo links to the site's default url. You can change this in portal_normal.vm of your theme.


There's isn't "community" in Liferay 6.1.0 so he's probably using 6.0.6 or earlier.

In 6.0.6, it's the following code in webapps\ROOT\html\themes\classic\templates\portal_normal.vm

<a class="logo" href="$company_url" title="#language("go-to") $company_name">
<span>$company_name</span>
</a>
Katarzyna B
RE: How to change logo's link
July 24, 2012 2:09 PM
Answer

Katarzyna B

Rank: New Member

Posts: 18

Join Date: January 7, 2012

Recent Posts

Hi,

thanks for suggestions emoticon I will provide you also with some details - we're using Liferay 6.0.6, and the case are only "Communities", which in Liferay API are called "companies" (correct me if I'm wrong, please).

I have this code set in theme's portal_normal.vm

1<h1 class="company-title">
2               <a class="logo" href="$company_url" title="#language("go-to") $company_name">
3                      <span>$company_name</span>
4              </a>
5</h1>


Unfortunately it doesn't work - the link under logo is http://localhost:8081/web/guest which matches <portal_url>/<default_landing_page>.

Is this a Liferay bug?
Hitoshi Ozawa
RE: How to change logo's link
July 24, 2012 2:38 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7990

Join Date: March 23, 2010

Recent Posts

nd the case are only "Communities", which in Liferay API are called "companies" (correct me if I'm wrong, please).


Liferay instances are "companies". "Communities" are "groups".

Unfortunately it doesn't work - the link under logo is http://localhost:8081/web/guest which matches <portal_url>/<default_landing_page>.


Did you clear your cache? I think I've tested this.
Katarzyna B
RE: How to change logo's link
July 28, 2012 9:35 AM
Answer

Katarzyna B

Rank: New Member

Posts: 18

Join Date: January 7, 2012

Recent Posts

Hitoshi Ozawa:
Did you clear your cache? I think I've tested this.


Yes, I have...

Still no success with this problem, but I found some strange behaviour - if I leave the href attribute empty - then it will link curent page.
Any tips here are welocome. Maybe there is a list of Liferay's velocity variables available somewhere?
Hitoshi Ozawa
RE: How to change logo's link
July 29, 2012 4:45 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7990

Join Date: March 23, 2010

Recent Posts

How are you changing your url? Are you providing full url?
Katarzyna B
RE: How to change logo's link
July 29, 2012 5:13 AM
Answer

Katarzyna B

Rank: New Member

Posts: 18

Join Date: January 7, 2012

Recent Posts

I change it through portal_normal.vm - is this what you're asking about?
I'm editing this part:
1<h1 class="company-title">
2                <a class="logo" href="" title="#language("go-to")">
3                    <span></span>
4                </a>
5            </h1>
Hitoshi Ozawa
RE: How to change logo's link
July 29, 2012 5:18 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7990

Join Date: March 23, 2010

Recent Posts

What did you change your url to? Something like http://www.liferay.com/community/
Katarzyna B
RE: How to change logo's link
July 29, 2012 5:25 AM
Answer

Katarzyna B

Rank: New Member

Posts: 18

Join Date: January 7, 2012

Recent Posts

Of course I can give the absolute URL of community as a href attribute, but this will make my theme bounded to this community, and I want to reuse it for others. I seek for something like "$company_url", but a working one ;) and for community.

As a side note - it's great Liferay has such powerful customisation mechanisms, but they'd be of much more use if working.....
Hitoshi Ozawa
RE: How to change logo's link
July 29, 2012 5:36 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7990

Join Date: March 23, 2010

Recent Posts

I'm confused at what exactly you really want to do. To exactly which page do you want to link to?
The original question was that you want to change theme's url to something else. Are you able to change it to something like http://www.liferay.com/community/ ?
Are you getting any error when you do this?

Exactly what error are you getting and what is your EXACT url when the error occurs.
Katarzyna B
RE: How to change logo's link
July 29, 2012 5:48 AM
Answer

Katarzyna B

Rank: New Member

Posts: 18

Join Date: January 7, 2012

Recent Posts

In my theme I'd really love to have a link under logo (banner) that - for whatever community that uses this theme - point's to community's home page.
In other words - If I have 2 communities A and B with their pages using my theme, when I'm on A's pages after clicking on logo I expect to be redirected to A's home page, while on any B's page - logo should link to B's main page.

I don't get any errors, apart from that I cannot find solution to my problem. You've suggested to set href="$company_url" in theme's portal_normal.vm - as an effect I get logo linking to portal's home page (side question - is this expected behaviour?). When I leave "href" attribute empty - it will link to page I'm currently on. None of those (href="$company_url" or href="") is what I look for.