5102 Posts in 1520 Topics by 1116 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1477 Views |
-
How to link the header to hompage?

14 November 2009 at 3:34am
Hi everyone,
I would like to have a link from the header of my page (same for all subpages & home) to the HomePage. The header contains only a picture and no text. How can I do this?
Thanks for your comments
Bex
-
Re: How to link the header to hompage?

14 November 2009 at 12:54pm Last edited: 14 November 2009 12:54pm
Well if its an image tag in the template you can just wrap it in a <a> tag.
Your current html might be something like -
<img src="MyHeader.jpg" alt="Header Image" />
To link it to the home page you change it to
<a href="home/"><img src="MyHeader.jpg" alt="Header Image" /></a>
-
Re: How to link the header to hompage?

17 November 2009 at 12:53am
not really...
the image is in the layout.css file:
#logo{
...
background: url(../images/picture.jpg) no repeat left top;}and I changed the page.ss file
<div id="logo">
<img src="picture.jpg" alt="Header Image" />
</div>But it is not working, what did I miss? (yes, I did the flush-thing...)
-
Re: How to link the header to hompage?

17 November 2009 at 1:45am Last edited: 17 November 2009 1:48am
Why do you specify a background via CSS and put an image in the logo div?
You can easily wrap the <img> in <a> Tags as willr pointed out.. you can even style the <a> tag to look and behave exactly like the <div> element there:<a id="logo" href="$BaseHref">
<img src="picture.jpg" alt="Header Image" />
</a>Then in CSS you have to change the #logo element from inline to block
#logo {
....
display: block;
} -
Re: How to link the header to hompage?

17 November 2009 at 2:56am
that was how the template "highway" was build, but I guess in the end it is because I am no ssspecialist but an enduser...
-
Re: How to link the header to hompage?

17 November 2009 at 4:09am
It doesn't really matter if you're a SilverStripe specialist or not. These are simple html/css issues. If you know CSS and HTML, you should be able to edit/modify the SilverStripe templates, since they are basically just HTML documents mixed with some special template markup.
At least adding the logo and a link to the homepage should not require any deep knowledge of SilverStripe or PHP. -
Re: How to link the header to hompage?

5 January 2010 at 4:11am
ok, after some trials and buying the book I finally got it. Not nice but running at least:
page.ss:
<div id="header">
<a id="logo" href="http://www.mywonderfullsite.com/">
</a>
...
</div>header.ss:
<div id="Header"
<a> id="logo" href"$BaseHref">
<img src="url(../images/picture.png" alt "Header Image" />
</a>
</div>layout.css:
...
background: url(../images/picture.png) no-repeat left top;
display: block;
...Thank you fo the help & all the best
Bex
| 1477 Views | ||
|
Page:
1
|
Go to Top |



