Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2017-10-08 19:28:24

johnsim
New Member
Registered: 2017-10-08
Posts: 2

Textpattern & custom folders like sass, images, js

Hi,

I would like to create my own theme folder structure. I’d like to be able and add my own image folder, js folder and sass folder (I want to use sass).
But when I create these folders inside the webroot: domain/textpattern, the files within my custom folders are not seen.

Is it possible to use custom folders for theming, or am I bound to predefined folder structures? If so, what are the paths and can I edit them directly on the server or is it restricted to the CMS?

Thanks,
John

Last edited by johnsim (2017-10-08 19:28:43)

Offline

#2 2017-10-09 07:52:05

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 421

Re: Textpattern & custom folders like sass, images, js

Textpattern manages it’s theme files and media (images, etc) via its web interface and stores them in the database.

If you want to you want to work with theme files within the directory structure a good place to start would be with the oui_flat plugin.

oui_flat (rah_flat fork) – Manage templates and prefs as flat files

Here’s a link to the documentation

Last edited by Algaris (2017-10-09 07:55:43)

Offline

#3 2017-10-09 08:03:57

etc
Developer
Registered: 2010-11-11
Posts: 2,284
Website

Re: Textpattern & custom folders like sass, images, js

Hi John, welcome to the forum.

You can use anything you like on the public side, including <script />, <link /> etc elements in your page template in the usual way. Probably, they should be placed outside textpattern directory which mainly contains admin-side stuff, but there is no restriction on the folders structure. Check, however, if by any chance .htaccess does not redirect them to index.php.

Writing an admin-side theme is trickier, I’d leave explanations with experienced theme authors.


etc_[ query | search | pagination | date | tree | cache ]

Offline

#4 2017-10-09 08:07:24

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 7,703
Website

Re: Textpattern & custom folders like sass, images, js

There’s a defined directory structure coming in the next version for themes. It’s something like this but Forms are separated into their own directories by type, instead of prefixed.


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

#5 2017-10-09 17:52:30

johnsim
New Member
Registered: 2017-10-08
Posts: 2

Re: Textpattern & custom folders like sass, images, js

etc wrote #307325:

…if by any chance .htaccess does not redirect them to index.php.

p.


That was the problem! It was a nginx misconfiguration on my part.
Thanks everyone for your help.

Cheers,
John

Offline

#6 2017-10-12 08:45:44

philwareham
Core designer
From: Farnham, Surrey, UK
Registered: 2009-06-11
Posts: 2,776
Website

Re: Textpattern & custom folders like sass, images, js

When the themes directory support lands in Textpattern 4.7-dev (the development version of Textpattern that will become Textpattern 4.7.0 in due course) you will have access to a directory in the root that will effectively act as a flat-file structure for themes. You can then use whatever build system you want to deploy (Gulp, Grunt, Webpack, etc.) to compile Sass/JavaScript/whatever into a theme and then import that into the system via the control panel or (hopefully) a web hook URL.

I am keeping a few repos of frameworks (Bootstrap, Zurb Foundation and a couple of others) on the back-burner until themes functionality is ready – at which point I’ll create functioning themes with each framework. You can see an example here (although it isn’t actually a theme as yet, the build chain is in place).

Offline

Board footer

Powered by FluxBB