Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2014-08-28 20:02:19

candyman
Member
From: Italy
Registered: 2006-08-08
Posts: 684

Re: image CSS formatting

Great! Solved the clean urls problem using TextWrangler: the alert was always there but the program let the user go on and save .htaccess. :)

The image, instead, isn’t loaded :(

Now I try with:

url("/images/top-panel.png")

and let to know (strange: on the server that was running fine)…

Last edited by candyman (2014-08-28 20:03:00)

Offline

#14 2014-09-10 19:23:23

candyman
Member
From: Italy
Registered: 2006-08-08
Posts: 684

Re: image CSS formatting

I can’t find the reason: my local install works fine except for the header image (that doesn’t appear) and for some article images that appear stretched.

My live install (that is under TXP 4.3) is OK, my local (4.5) not.
Every files are duplicated (from live to local) and in the same places.

Clue: the header image is bigger than what appear on the browser.

Are there any deprecated functions that may cause problems?

Any suggestion is appreciated.

The css is this:

.wrap { width:960px; margin:0 auto; overflow:auto; }

#top-panel { background:#ABD url(/images/top-panel.png) center bottom no-repeat; }

Last edited by candyman (2014-09-10 21:02:40)

Offline

#15 2014-09-10 21:30:56

candyman
Member
From: Italy
Registered: 2006-08-08
Posts: 684

Re: image CSS formatting

Edit: the CSS works except for the imags: they’re not loaded.
The path is OK.

url(/images/file.png)

Last edited by candyman (2014-09-10 21:31:14)

Offline

#16 2014-09-10 22:11:19

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: image CSS formatting

candyman wrote #283653:

The path is OK.

url(/images/file.png)

The CSS syntax is OK, too. Now, when you put your system’s path to the local site (like http://localhost:8888/your_site) in the browser’s address bar, followed by that image URL, does the image show up?


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#17 2014-09-10 22:17:43

candyman
Member
From: Italy
Registered: 2006-08-08
Posts: 684

Re: image CSS formatting

Yes! I can see:

localhost/mysite/images/file.png

p.s.: I’ve localized the images folder (Immagini, in Italian) but I don’t think it’s the problem (obviously I’ve changed all the urls, the ones in CSS too).

The problem is that the CSS don’t see the images folder… Weird…

Last edited by candyman (2014-09-10 22:25:18)

Offline

#18 2014-09-11 08:41:41

candyman
Member
From: Italy
Registered: 2006-08-08
Posts: 684

Re: image CSS formatting

Tried with apostrophes and ../ with no luck :(

Last edited by candyman (2014-09-11 08:41:50)

Offline

#19 2014-09-11 09:25:58

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

Re: image CSS formatting

I’ve skim-read, so forgive me if I’ve missed something or this sounds idiotic. This:

url(/images/file.png)

…translates to this:

localhost/images/file.png

Because / will go to localhost and not localhost/mysite. If you’re dev’ing for a live site with, say, example.com as the domain, then the mysite part is a subdirectory. If you open the web inspector and inspect where the image should be, what is the URL it’s looking for?

Last edited by gaekwad (2014-09-11 09:26:14)

Offline

#20 2014-09-11 09:39:02

candyman
Member
From: Italy
Registered: 2006-08-08
Posts: 684

Re: image CSS formatting

With the inspector of chrome I can’t find the url :(

Anyway, yes, I think you solved the puzzle!

My live site is: http://mysite.com

My local site is: localhost/mysite

In the Prefs I’ve put as TXP url site: localhost/mysite

So, how can I solve this? I’ve to create a custom CSS for the local site?

Many thanks :)

Offline

#21 2014-09-11 09:42:38

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

Re: image CSS formatting

You could try:

url(/mysite/images/file.png)

It’s a dev-only hack – don’t forget to take it out when you switch to your live site, but it should work.

Offline

#22 2014-09-11 09:54:43

candyman
Member
From: Italy
Registered: 2006-08-08
Posts: 684

Re: image CSS formatting

It doen’t work.
Anyway I’m pretty sure the problem is this.
Now I try to move the full images folder…

Edit: it worked! :)

I copied the full images directory under the localhost folder.
So, the images of the articles are loaded in the images folder, the CSS ones in its copy.

Last edited by candyman (2014-09-11 09:57:50)

Offline

#23 2014-09-11 09:58:54

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: image CSS formatting

you have to change the paths of the images in your css.

As such… yes, you have to create a custom css for your locals site where the images will be on /mysite/img.jpg


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#24 2014-09-11 10:21:36

candyman
Member
From: Italy
Registered: 2006-08-08
Posts: 684

Re: image CSS formatting

Thanks all for the (usual) help.

So the TXP designers usually create a custom CSS for their local installs?
Or is there another method to avoid the problem?

Offline

Board footer

Powered by FluxBB