Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » How do I…?
  3. » Themes

#1 2025-01-16 15:25:07

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,122
Website GitHub Mastodon Twitter

Themes

As I mentioned earlier in this forum, I’m working on a modernised css theme for the front end of our site. As such I duplicated the existing theme and I am previewing my progress in the front end.

I nevertheless have 2 issues with it.

  1. I can not control which theme I am looking at, as txp always opts to render articles using the theme which is under development. This means that I cannot preview new draft articles in the “live” theme.
  2. Plugins and shortcodes are not parsed in the front end previews,even on live articles.

I’m sure I am doing something wrong here, and any advice of what it is would be very much appreciated. If I am nevertheless doing it right, shouldn’t6 there be an option somewhere to control which theme we are viewing the front end with, when we are logged in?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#2 2025-01-16 15:43:58

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

Re: Themes

When you are logged in, you always see any development version for pages/styles/sections that have a dev lane. If you want to see the existing site, the only way is to log out or use an incognito session.

For draft articles, this may pose issues, as you say, because you need to be logged in to see them.

As for the parsing of tags, are you running 4.90-dev? That should be able to do it.

Can’t think of an obvious way to see the live theme while logged in, without making it super confusing which is which. We could maybe introduce a way to toggle it by clicking the (dimmed or active?) asset from the sections panel to swap to the live view. And then click the opposite one to switch back on a section by section basis. That might work.

Failing that, it might be possible with a plugin to temporarily override the theme name or maybe even the development pref on-the-fly all the time the plugin is active, switching back to core behaviour when the plugin is disabled. That might give you a neat(ish) method to control which you’re viewing.

Not sure.


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 2025-01-16 17:25:29

giz
Member
From: New Zealand
Registered: 2004-07-26
Posts: 320
Website GitHub Twitter

Re: Themes

I’m happy with how dev themes work, but I suspect I’d struggle if I didn’t use etc_flat.

  1. dev theme lives on disk. Shortcodes, plugins etc behave as expected. I can work knowing I can’t affect the public site (I occasionally pop open a private window to check that its so :).
  2. public theme lives in the database, and is synched with dev version periodically.

My only beef? I need to remember that if the url is say /?f=myform I’m accessing the database version and not dev. This catches me out regularly!

Offline

#4 2025-01-16 17:52:29

etc
Developer
Registered: 2010-11-11
Posts: 5,295
Website GitHub

Re: Themes

There is a per user Enable development theme preview? pref, so you can create two admin users and open two parallel sessions (in isolated browsers or tabs).

IIRC, when you duplicate a theme, shortcodes are not copied (existing issue). Plugins should work, though.

Offline

#5 2025-01-16 18:12:10

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

Re: Themes

Two users… Nice workaround. Forgot about that.


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

#6 Yesterday 00:38:54

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,264
Website

Re: Themes

Bloke wrote #338840:

Two users… Nice workaround.

Yes, that is nice for you as a developer / editor. I’ve used it a few times. It is a little more tricky if you are working with a client who’s logged in to do some content editing or creation. At the same time, you want to show changes you’re doing or they want to see/ approve / comment on / … changes your are preparing.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#7 Yesterday 04:58:50

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,122
Website GitHub Mastodon Twitter

Re: Themes

etc wrote #338839:

There is a per user Enable development theme preview? pref, so you can create two admin users and open two parallel sessions (in isolated browsers or tabs).

That was it! Maybe, there should be a pull-down on the write tab to select the theme for article previews.

Also, as I have no real world experience on this, what happens when someone is working on two additional themes? Which one is it used for previewing the design or the articles on the front end?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#8 Yesterday 06:30:36

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

Re: Themes

colak wrote #338848:

what happens when someone is working on two additional themes? Which one is it used for previewing the design or the articles on the front end?

The one you have assigned its page/style to the development lane on the Sections panel. See the Change page/style multi-edit option.


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

#9 Yesterday 16:24:27

giz
Member
From: New Zealand
Registered: 2004-07-26
Posts: 320
Website GitHub Twitter

Re: Themes

phiw13 wrote #338847:

It is a little more tricky if you are working with a client who’s logged in to do some content editing or creation. At the same time, you want to show changes you’re doing or they want to see/ approve / comment on / … changes your are preparing.

…add in two versions of the css (the original on my Mac, occasionally synchronised to the server version) and I find myself regularly confused!

Offline

#10 Yesterday 17:00:51

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

Re: Themes

phiw13 wrote #338847:

It is a little more tricky if you are working with a client who’s logged in to do some content editing or creation. At the same time, you want to show changes you’re doing or they want to see/ approve / comment on / … changes your are preparing.

Hmm in theory the dev lanes should only be open to those who have privs to do so. I didn’t think Copy Editor and below fell into that camp. But we should maybe check.


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 Yesterday 21:14:21

etc
Developer
Registered: 2010-11-11
Posts: 5,295
Website GitHub

Re: Themes

Bloke wrote #338855:

Hmm in theory the dev lanes should only be open to those who have privs to do so.

That’s right, currently levels 1, 2 and 6.

I don’t find asking a client to switch the pref on/off too annoying, but other suggestions are welcome.

Offline

#12 Today 03:16:40

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,264
Website

Re: Themes

Bloke wrote #338855:

Hmm in theory the dev lanes should only be open to those who have privs to do so.

Yes, but client(s) usually get some more rights, how else would they manage the website (add user, … … …)?

etc wrote #338856:

[…] I don’t find asking a client to switch the pref on/off too annoying […]

It is not a big problem by itself, but sometimes some (serious) handholding is needed…


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

  1. Index
  2. » How do I…?
  3. » Themes

Board footer

Powered by FluxBB