Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2025-09-02 19:42:25

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

Working with multiple versions of a theme

When working with multiple versions of a theme on the same site, is there a sane way to switch between them?

For example, I’m making a theme called ‘Lemon’. If Lemon v1.0.0 is active and I’m working on v1.1.0 of the same theme, the only route I can think of is to have a temporary WIP theme with the v1.1.0 version, and call it ‘Lemon WIP’. I can flip the design over to use that theme when the work is complete, after a renaming dance to make ‘Lemon’ (v1.0.0) into ‘Lemon Old’ and ‘Lemon WIP’ (v1.1.0) into ‘Lemon’, and switch the appropriate sections to use the updated theme.

I can sidestep this by appending the version number to the theme name (e.g. ‘lemon@1.0.0’ or similar), but I’m curious if any theme hounds out there have another route.

Thank you.

Online

#2 2025-09-02 20:30:06

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,987
Website GitHub

Re: Working with multiple versions of a theme

I think I’d probably do it the way you mention with a second theme name and then a renaming exercise later.


TXP Builders – finely-crafted code, design and txp

Offline

#3 2025-09-02 22:05:09

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

Re: Working with multiple versions of a theme

Haven’t you just described the live/dev lane process? Or have I missed something?

If you activate Dev Preview in your Prefs and Lemon v1.0.0 is active (live), then clone the theme and give it a v1.1.0.

From the Sections panel, use the multiedit to set one or more Sections to use Lemon v1.1.0. By default, that will set up dev lanes and leave the live site running v1.0.0. You’ll see the split on the Sections panel.

Edit the v1.1.0 assets to suit (make sure you’re editing the right theme assets!). All the while you’re logged in, you’ll see the new theme. But incognito sessions or non-logged-in peeps will continue to be served 1.0.0 on those sections. Any sections that don’t have a dev lane, you and the world will all see 1.0.0.

When you’re happy with the new theme, use multi-edit on the Sections panel again to select the sections you want to make live and choose Dev Preview -> Deploy to live.

Done. Lemon v1.1.0 is now deployed. Backup and then delete v1.0.0 when none of its assets are active.

Rinse / repeat.

The only time this doesn’t work as smoothly is when you have two dev themes in play. But you can still assign one to some sections and a different one to other sections. Mix and match to taste, then visit those sections as a logged-in user to see how they look.

Nothing to stop you having two or more completely different themes live at once with a mix of assets. E.g. your front page might use Lemon but example.org/forum might use Tangerine.

Themes in Txp are a thing of beauty and flexibility 😎


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

Online

#4 Yesterday 08:21:43

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

Re: Working with multiple versions of a theme

Bloke wrote #340389:

Haven’t you just described the live/dev lane process? Or have I missed something?

If you activate Dev Preview in your Prefs and Lemon v1.0.0 is active (live), then clone the theme and give it a v1.1.0.

Sort of. Ish. There’s still a requirement for a uniqueness to the theme name, which I can live with. I’m coming from a regimented /vendor/product/version/ background but I can’t apply that to themes – which is totally OK now I understand the approach.

There’s maximum one dev theme in the mix, but it’s likely a newer version of an existing one, so the best route I can find is the version suffix approach since /themes/lemon/1.1.0/ isn’t something I can easily replicate in Textpattern (and bluntly, a) life’s too short; b) youse guys know what you’re talking about about so I listen & learn).

It could be me not explaining it clearly, but I can certainly get by with a few workarounds until I can properly explain the self-imposed contortions I’m doing.

Online

#5 Yesterday 08:22:27

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

Re: Working with multiple versions of a theme

jakob wrote #340385:

I think I’d probably do it the way you mention with a second theme name and then a renaming exercise later.

Thanks, jakob. It’s a dance exercise I can handle given the frequency of updates!

Online

#6 Yesterday 09:13:53

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

Re: Working with multiple versions of a theme

gaekwad wrote #340395:

There’s still a requirement for a uniqueness to the theme name… I’m coming from a regimented /vendor/product/version/ background but I can’t apply that to themes… /themes/lemon/1.1.0/ isn’t something I can easily replicate in Textpattern.

No, we only have two directory layers. /themes/lemon-1.0.0 is the best you can get, if you define your theme as:

Name: lemon-1.0.0
Title: Lemon
Version: 1.0.0

Setting the version number means you see Lemon (1.0.0) in the Theme dropdowns throughout the UI, which helps visually distinguish them.


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

Online

#7 Yesterday 09:15:04

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

Re: Working with multiple versions of a theme

Bloke wrote #340403:

Setting the version number means you see Lemon (1.0.0) in the Theme dropdowns throughout the UI, which helps visually distinguish them.

Thanks, Bloke. This is the route I’ll take. I appreciate your additional brainmeats, as always!

Online

Board footer

Powered by FluxBB