TYPOlight version 2.6.2 available
TYPOlight version 2.6.2 is available. The maintenance release includes some powerful new features like the extension repository client, a pagination menu for articles, the memberlist module and the option to move news and events between archives.
Read the announcement of all changes
rachel
TYPOlight novice
Posts: 13
London, United Kingdom
I have what seems to be an odd bug. Sometimes when I edit an article, the system reverts to an older version of my custom style sheet, and I have to upload the current version again.
I never use the css editor in the back end, but I do import my style sheets there when I first set up a site, and then in page layouts tell the layout which style sheet to use. But even so, I really can't understand why saving an article would make the style sheet revert.
Can anyone explain what's going on, and how to fix it?
Thanks
2008-10-06 22:58
ramjet
TYPOlight intermediate
Posts: 201
rachel, it is perhaps a browser cache problem?
2008-10-07 23:13
rachel
TYPOlight novice
Posts: 13
London, United Kingdom
Sorry for the delay in replying.
No, it's definitely not a caching problem. What we're talking about is a stylesheet which was uploaded weeks ago (and which has been displaying perfectly on all browsers ever since) occasionally reverting to an earlier version, the original test version which I first imported to typolight back when I first set up the site.
It happens sometimes when I edit text through typolight. It happened again today when I uploaded a favicon and a new template.
I can only think that this is because I don't edit the stylesheet through typolight - I edit it offline, then upload it via ftp, ie I just overwrite the old version. Perhaps the original version is still stored in the database somewhere from when I first imported it, and is occasionally overwriting the actual css file. But why would it do that apparently at random? And is there any way to stop it? Am I just going to have to remove it from typolight completely and just link to it through a modified fe_page?
Would really suggestionson this one - I can't have customers' sites reverting to some crappy test version of the css whenever they do an update.
2008-10-14 05:37
Antipitch
TYPOlight intermediate
Posts: 128
St. Pauli
Hi Rachel,
never came about such a behaviour. Also I can hardly believe TL should fall back to an older (non-existing?!) CSS file after articles oder texts have been changed. Hm...
What I could imagine, though, is that you either stored your new css in the root folder instead of tl_files/your_css_folder or didn't re-import your css after updating it externally. As long as you don't do a new import TL will take what has originally been imported and write that file to the root folder. Could that be the case?
cheers
Antipitch
2008-10-14 12:22
rachel
TYPOlight novice
Posts: 13
London, United Kingdom
Hi Antipitch, thanks for the reply.
Yes, both are the case.
When I first imported the css, I uploaded it to tl files (because as far as I can see there's no way to browse outside that folder when importing), then imported. But the css didn't display, because TL had written the link in the html to point to that css file but at the root level. So I then uploaded the css to the root level, and all seemed well.
So after that, any time I did a css update, I just overwrote that file at the root level. I didn't import, because to do so I'd have had to upload the file to tl files as well as to the root, *and* import it, and that all seemed crazy given that I was uploading new css about 20 times a day and the import function didn't seem to be working as expected (ie just importing the css didn't result in those css changes being visible, because the html was pointing to a file at the root level).
Can you tell me what is the theoretically correct way to go about:
a) setting up your style sheet in the first place and
b) updating it thereafter?
Many thanks,
Rachel
2008-10-15 20:51
ramjet
TYPOlight intermediate
Posts: 201
this should work rachel..
1.use file manager to upload your css wherever.
2.go to stylesheets - import your css from the folder you uploaded to.
3.edit this imported style sheet in stylesheets editor.
OR edit your style sheet offline, and repeat steps 1 and 2 (this will overwrite your existing imported stylesheet).
My understanding is that 'import' places a copy in the root folder that is sent to the browser and also populates the database, so that online editing is possible.
So any uploaded or off-line altered stylesheet MUST be imported each time.
Oh, and the stylesheet must be applied to the page layout too.
Last edited by ramjet, 2008-10-16 00:48
2008-10-16 00:43
Antipitch
TYPOlight intermediate
Posts: 128
St. Pauli
Hi Rachel,
then we've found the problem. TL pointing at a root level file is exactly what it's supposed to do, because it normally writes a copy of the imported css to the root level. And it does that contineously. So when you change the root level file directly your changes will be overwritten pretty soon.
To avoid this you can write the link into the field "Additional head tags" in the BE layout. Or if you have your own page template (in folder templates) you can hardcode the link into that. Make sure that you don't import this css file and that you save it into folder tl_files (/css or whatever). Especially during the development of a page and using your own editor this is faster than importing/ saving all the time. Just make sure that your own css plays well with TL'S css (other imported files, user generated css from articles etc.).
cheers
Antipitch
2008-10-16 01:01
rachel
TYPOlight novice
Posts: 13
London, United Kingdom
Thanks guys.
Ramjet said:
> My understanding is that 'import' places a copy in the root folder that is sent to the browser and also populates the database, so that online editing is possible.
It doesn't! That's why I had to upload it myself the first time. Anyone else have that problem?
I guess I'm going to have to do what you suggest, Antipitch - stick the stylesheet into the page template or head fields.
Rachel
2008-10-23 00:06
Total Members: 2994
Total Topics: 8162
Total Messages: 54407