Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-11-10 20:22:34

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

logo image replacement not working

has anyone else had this problem? i’m trying out the technique as shown here

what happens is it looks fine with the web developer toolbar turned on and editing CSS, and then when i flip it off the logo image disappears.

in the main document i have:

<div id="logo">
<h1>Site Title</h1>
</div>
logo h1 {
display:block;
width:250px;
height:46px;
text-indent:-9009px;
background:transparent url(my-company.jpg) no-repeat 0 0;
}

Offline

#2 2008-11-10 20:49:15

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: logo image replacement not working

Check your logo id?

#logo h1 {
display:block;
width:250px;
height:46px;
text-indent:-9009px;
background:transparent url(my-company.jpg) no-repeat 0 0;
}

Offline

#3 2008-11-10 20:54:12

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: logo image replacement not working

well my div id is “logo”, and i used “logo h1” in the css. i’m not sure what to check hehe

Offline

#4 2008-11-10 21:19:12

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: logo image replacement not working

rsilleti is pointing you to add the # before logo, on your CSS.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#5 2008-11-10 21:42:30

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: logo image replacement not working

oh sorry, yeah that was in the css, just not pasted over in this thread. my mistake there.

Offline

#6 2008-11-10 22:08:57

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: logo image replacement not working

Is the path to the image the correct one? (you should use an absolute path)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#7 2008-11-10 22:09:44

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: logo image replacement not working

Have you tried changing the path to your image? Maybe you need something like /my-company.jpg or ../my-company.jpg.

edit: late again… ;)

Last edited by els (2008-11-10 22:10:13)

Offline

#8 2008-11-10 23:09:11

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: logo image replacement not working

but if the path is wrong, doesn’t that mean the web developer toolbar won’t be able to display the image?

Offline

#9 2008-11-11 09:06:35

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

Re: logo image replacement not working

mrtunes, is your page online?


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

#10 2008-11-11 09:26:23

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: logo image replacement not working

maniqui wrote:

Is the path to the image the correct one? (you should use an absolute path)

do you mean it’s better to put the url as http://mysite.com/mypic.jpg rather than something like image\mypic.jpg ? i will admit i have always found this part confusing.

kemie: no my site is being done locally in xampp unfortunately, but if the problem persists a lot longer i will go live with it without the h1 title tag and fix it once it’s live.

Offline

#11 2008-11-11 12:09:34

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,730
Website

Re: logo image replacement not working

mrtunes wrote:

maniqui wrote: Is the path to the image the correct one? (you should use an absolute path)

do you mean it’s better to put the url as http://mysite.com/mypic.jpg rather than something like image\mypic.jpg ? i will admit i have always found this part confusing.

Absolute links (beginning http://…) are the surefire way to ensure you link to the image but the disadvantage is that you will need to update the link when you transfer from home webserver to your online version. If you link to the file directly from within a txp page, you can use <txp:site_url /> to avoid this but for css this is not possible.

In such cases a relative url (of the kind “image/mypic.jpg” or “../image/mypic.jpg”) is better. You can use the network pane of firefox’s firebug plug-in or the safari developer tool to find out why an image is not being found.


TXP Builders – finely-crafted code, design and txp

Offline

#12 2008-11-11 12:14:17

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,453
Website GitHub

Re: logo image replacement not working

jakob wrote:

If you link to the file directly from within a txp page, you can use <txp:site_url /> to avoid this but for css this is not possible.

… unless you use smd_style to display your (database-held, not ‘real’) stylesheets, in which case you can choose to parse tags inside them ;-)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB