How to set dynamic home page link in image logo?

1.2k Views Asked by At
MySite.com

when I click site logo, wanna appear sitefinity home page. how to set href atrribute in sitefinity as sitefinity CMS is dynamic home page?

2

There are 2 best solutions below

0
SelAromDotNet On BEST ANSWER

there are several ways to achieve this, depending on how you have your logo setup on the page.

Your home page is usually setup to load when you visit the top level domain, which is at the root of your site.

If this is the case and you have your logo defined in a .master page, you can easily set the link to be the root, like

<a href="/"><img /></a>

If, on the otherhand, you have the image on a sitefinity page or template, you need to make sure that you're adding the image inside a ContentBlock, and not the Image widget from the sidebar. This widget is only used to disaply an image, not link one.

by adding the image to the content block, you can then select it and add a link from the radeditor toolbar to the home page (or any other page)

hope this is helfpul!

0
Patrik Affentranger On

Another, rather easy way of doing this would be using your url http://www.mysite.com as href for the logo, which is not too bad either (Although not as dynamic anymore)

But still helpful, especially if you are using some code in your print.css that looks like this:

a:link:after,
a:visited:after {
    content: " (" attr(href) ") ";
    font-size: 90%;
}

and renders href links after your actual links on printed pages.

This would result in something like the below:

[your company logo] http://www.mysite.com