Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-10-16 18:34:10

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Best practices for managing CSS with Textpattern

I’d like to hear some feedback on the best way to manage stylesheets on a Textpattern site. Right now I see two main options:

  • Paste the stylesheets into TXP’s Presentation tab and serve them using <txp:css />.
  • Put them on the server as static files.

The first method can be supported by plugins such as rvm_css and cnk_versioning, but I’m not clear on the advantages of using Textpattern to manage CSS.

There is one benefit TXP might offer for stylesheets: the ability to parse Textpattern tags. This is very helpful when developing on a different server than the destination— I can put <txp:site_url /> to dynamically include the correct file paths for includes and images. But as far as I can tell, this only works for CSS declarations in the head element, not for CSS managed in the presentation tab.

Is that correct? Does anyone use the Presentation tab to manage styles? If so, what benefits have you found in using this method?

Textmate, the TXP bundle, and cnk_versioning have been a magnificent combo for managing TXP pages and forms. What is your experience and best practices dealing with CSS?

Thanks!

Offline

#2 2008-10-16 19:41:22

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: Best practices for managing CSS with Textpattern

johnstephens wrote:

Does anyone use the Presentation tab to manage styles? If so, what benefits have you found in using this method?

I do, mainly because I’m lazy. I try to keep my css as simple as possible and managing it through the Textpattern backend allows me to quickly modify it without the need to fire up a separate css editor and ftping it. I’m planning to install ruud’s plugin on some sites when I get a chance.

Offline

#3 2008-10-16 20:37:21

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Best practices for managing CSS with Textpattern

I also use the Presentation tab to manage my CSS. I find it much simpler to modify and see immediate results without going all through the download/edit/upload routine and if you have separate CSS for IE6 and below, IE7 and above and maybe CSS for a gallery or other add-on the benefits are multiplied. I also use Ruud’s rvm_css plug-in so I get the speed of using a static CSS file(s). I don’t bother with versioning but don’t hold that against me. ;)

Something else that I use which you may be interested in is Mary’s upm_insert_tab plug-in which allows you to “tab” inside textareas so you can keep that “edited-in-my-favourite-code-editor” look.

Last edited by thebombsite (2008-10-16 20:41:44)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#4 2008-10-16 21:22:02

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

Re: Best practices for managing CSS with Textpattern

I use the presentation tab as well, for all the reasons Stuart pointed out, together with Firefox extension It’s All Text! So the editing can be done in my text editor – with all it’s advantages like search, replace and the like – and I still don’t have to ftp :)

Offline

#5 2008-10-16 21:47:07

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: Best practices for managing CSS with Textpattern

johnstephens wrote:

There is one benefit TXP might offer for stylesheets: the ability to parse Textpattern tags. This is very helpful when developing on a different server than the destination— I can put <txp:site_url /> to dynamically include the correct file paths for includes and images. But as far as I can tell, this only works for CSS declarations in the head element, not for CSS managed in the presentation tab.

ako_cssParse sorta allows for TXP tags in the Presentation>Style tab.

Personally, I just use static files and update with rsync if possible, but otherwise, plain FTP.

Offline

#6 2008-10-16 22:39:36

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

Re: Best practices for managing CSS with Textpattern

fwiw, I too use the built-in Presentation tab for managing stylesheets + rvm_css for delivering them zoooooooooooommmm stylie.

I’ve never tried TXP tags in stylesheets but believe it doesn’t work, as you state, unless in a page/form.

When editing CSS I tend to use the Firefox dev toolbar by Chris Pederick. Probably not as slick as TextMate but I can’t afford a Mac :-) Ctrl-Shift-E brings up the CSS panel, I can edit and see the changes in real-time on the page, when I’m happy with how it looks, I can copy the new sheet from the dev toolbar panel and paste it into the TXP Styles window. Save, refresh, done.

Then spend the next 3 days trying to make the page look right in IE :-(

Last edited by Bloke (2008-10-16 22:42:26)


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

#7 2008-10-17 06:06:50

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Best practices for managing CSS with Textpattern

I just use the TXP styles tab for managing the CSS, its so much easier. Also rvm_css on some sites. Personally, I find CSSEdit the easiest way to edit my CSS. Edit, see the changes in the preview window, then copy and paste. Easy :-)

Offline

#8 2008-10-17 08:29:21

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

Re: Best practices for managing CSS with Textpattern

I have never liked having CSS within the txp interface. In the beginning I’d copy and paste, but it seemed more of a hassle than ftp-ing.

I usually have a static CSS file (that is usually done with the basic html layout before i even start with txp) ftp’d to the server, or edited/saved directly there with Stylizer which, i recommend very highly, asi it as a css-edit-like ability of letting you edit and see changes live in both ie and ffox


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

Offline

#9 2008-10-17 08:37:25

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Best practices for managing CSS with Textpattern

I try to get my CSS ready with the static HTML mockup and do later refinements employing the Firefox Webdesigner Toolbar/Firebug >> Paste to TXP method.

Offline

#10 2008-10-17 08:40:13

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

Re: Best practices for managing CSS with Textpattern

kemie wrote:

…Stylizer which, i recommend very highly

Hey thanks for the link, that looks very neat. If I ever find a decent freeware FTP tool that works the way I want to work (coreftp, filezilla, smartftp, ftp commander, ncftp, etc don’t deliver quite what I’m after and all suffer from minor annoyances that curb my enthusiasm) I might give it a go.

On a slightly OT but semi-related note, another firefox extension that I’ve heard good things about but never tried is Dustme selectors which will allegedly crawl a site/page for unused rules and allow you to clean up some of the inevitable 100 billion redundant CSS rules in a typical project. Yay!

Last edited by Bloke (2008-10-17 08:43:12)


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

#11 2008-10-17 15:07:59

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: Best practices for managing CSS with Textpattern

kemmie> mon mac version of stylyzer, poo!
bloker> Dustme is really useful, wish I didn’t have to crawl through and manually cleanup. I’m one lazy bugger.

Offline

#12 2008-10-17 15:14:22

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: Best practices for managing CSS with Textpattern

Dustme is really useful, wish I didn’t have to crawl through and manually cleanup. I’m one lazy bugger.

You mean one lazy *de*-bugger.

Thanks for your feedback all!

Offline

Board footer

Powered by FluxBB