Foros de discusión

How to Link Compony Logo with external URL instead of FrindlyURL

thumbnail
Nitesh Sahay, modificado hace 10 años.

How to Link Compony Logo with external URL instead of FrindlyURL

Junior Member Mensajes: 58 Fecha de incorporación: 28/11/11 Mensajes recientes
I want to set the logo of organization and links to it's site after login to portal.
I can able to set the the compony logo and name by setting the value in vm variables in service pre event.And customize the theme accordingly.
<header id="banner" role="banner">
		<div id="top-section">
    		<div id="heading">
        		#if ($is_signed_in)
        			<h1 class="site-title">
        				<a class="$logo_css_class" href="$company_site_default_url" title="#language(" go-to") $company_site_name">
        					<img alt="$company_logo_description" height="60" src="$images_folder/$company_site_logo">
        				</a>
        			</h1>
        		#else
        			----------
		    </div>
		</div>
	</header>

But i want to link the Company logo with external url(it should be dynamic) instead of friendly URL.
Lifery always create renderURL for all the anchor tag i found.Is there any way to set external url instead of friendly URL.
Thanks in advance.
thumbnail
Apoorva Prakash, modificado hace 10 años.

RE: How to Link Compony Logo with external URL instead of FrindlyURL

Liferay Master Mensajes: 658 Fecha de incorporación: 15/06/10 Mensajes recientes
Nitesh Sahay:
I want to set the logo of organization and links to it's site after login to portal.
I can able to set the the compony logo and name by setting the value in vm variables in service pre event.And customize the theme accordingly.
<header id="banner" role="banner">
		<div id="top-section">
    		<div id="heading">
        		#if ($is_signed_in)
        			<h1 class="site-title">
        				<a class="$logo_css_class" href="$company_site_default_url" title="#language(" go-to") $company_site_name">
        					<img alt="$company_logo_description" height="60" src="$images_folder/$company_site_logo">
        				</a>
        			</h1>
        		#else
        			----------
		    </div>
		</div>
	</header>

But i want to link the Company logo with external url(it should be dynamic) instead of friendly URL.
Lifery always create renderURL for all the anchor tag i found.Is there any way to set external url instead of friendly URL.
Thanks in advance.


There are two possible ways:
  • Create a hook, with searvice pre action. Create custom velocity variable having value of external URL you want to hyperlink. Use this in your theme velocity template.
  • save the external URL in expando attribute and fetch the same directly in theme velocity template.

    HTH.
thumbnail
Nitesh Sahay, modificado hace 10 años.

RE: How to Link Compony Logo with external URL instead of FrindlyURL

Junior Member Mensajes: 58 Fecha de incorporación: 28/11/11 Mensajes recientes
Hi Apporva,
Thanks for reply.I have already created hook with service pre event and set company_site_default_url in VM variables .But i found the url becomes prefixed by the default base URL and this lid to redirect to some status not found page of liferay portal.

For example... I set "www.google.com" to company_site_default_url but when click on the logo link it redirect to
http://localhost:8080/group/www.google.com
instead of
www.google.com
.

Any suggestions... thanks in advance.
thumbnail
Apoorva Prakash, modificado hace 10 años.

RE: How to Link Compony Logo with external URL instead of FrindlyURL

Liferay Master Mensajes: 658 Fecha de incorporación: 15/06/10 Mensajes recientes
Nitesh Sahay:
Hi Apporva,
Thanks for reply.I have already created hook with service pre event and set company_site_default_url in VM variables .But i found the url becomes prefixed by the default base URL and this lid to redirect to some status not found page of liferay portal.

For example... I set "www.google.com" to company_site_default_url but when click on the logo link it redirect to
http://localhost:8080/group/www.google.com
instead of
www.google.com
.

Any suggestions... thanks in advance.


Create a new Velocity variable, say company_site_default_ext_url, and now use the following in your templete:

<a class="$logo_css_class" href="$company_site_default_ext_url" title="#language(" go-to") $company_site_name">
        <img alt="$company_logo_description" height="60" src="$images_folder/$company_site_logo">
 </a>

HTH.
thumbnail
Nitesh Sahay, modificado hace 10 años.

RE: How to Link Compony Logo with external URL instead of FrindlyURL

Junior Member Mensajes: 58 Fecha de incorporación: 28/11/11 Mensajes recientes
Thanks for the response.But sorry to say still its not working.....
thumbnail
Ryan Schuhler, modificado hace 10 años.

RE: How to Link Compony Logo with external URL instead of FrindlyURL

Junior Member Mensajes: 77 Fecha de incorporación: 6/07/12 Mensajes recientes
I havent tested this for your specific problem, but sometimes I know you have to add the "http://" in front of the url. It might be worth a try make the link you enter "http://www.google.com" instead of "www.google.com". Not sure if it will work, but its worth a try.
Bruno Lima, modificado hace 9 años.

RE: How to Link Compony Logo with external URL instead of FrindlyURL

Junior Member Mensajes: 49 Fecha de incorporación: 20/05/14 Mensajes recientes
Yes, I've tested right now and worked fine on 6.2 EE!