Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 Today 11:44:21

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

Is the default style (default.css) mandatory?

I’m designing a theme that doesn’t use the default style, so default.css doesn’t exist in the file tree. The theme is assigned to a single section, which uses a different, non-default style in its settings. In theory, there should be no need for the default style to exist in the admin-side: no sections use it for that theme, and since it doesn’t exist in the file tree locally or remotely, there’s no need for it to created when I update the theme from disk.

When I update an existing theme from disk, the default style is created with its default content. The only reason I can think of for this happening – aside from being a bug – is that default style is essential…but it’s demonstrably not since it can be deleted if no sections are using it.

Textpattern 4.9.0 beta 2. Zero Pete esoterica / funny business in effect.

Any advice gratefully received. Thank you.

Last edited by gaekwad (Today 11:55:51)

Offline

#2 Today 12:31:22

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

Re: Is the default style (default.css) mandatory?

This could be construed a bug. Probably because a section has to have at leat one CSS file and at least one page, the theme importer is cautious and assumes that if there’s isn’t a default.css and default page in your database, that you need one of each.

It could be a bit cleverer and check if you have at least one page+style assigned to a section and, if so, skip asset creation. Pretty sure there’s an array defined in the Skin class for “essential” content and these particular names fall in that camp.

Current workaround: delete the placeholder it created and rename your real CSS file default.css.


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

#3 Today 12:32:42

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

Re: Is the default style (default.css) mandatory?

Thanks, Bloke – makes sense. I’ll work around it for now.

Offline

Board footer

Powered by FluxBB