Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2018-09-17 08:35:02

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

Re: [SOLVED] Txp serving template from different theme than the 1 selected

NicolasGraph wrote #314076:

Couldn’t the reminder be displayed only after a section+theme couple checking?

It’s not only the reminder. Suppose that your final site is designed in such a way that Section A uses Theme A and Section B uses Theme B. You have stopped working on the design but continue publishing articles. So you are still logged in and served the assets from your last working theme, say A, even when viewing section B. If they differ (otherwise what’s the point of using two themes?) you can get a wrong view. And if later you add a Section C with its own Theme C, the whole site is switched (for you) to Theme C.

We might introduce two themes fields per section: live theme and dev theme. You could then choose per section which themes are served to visitors/admins.


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

Offline

#12 2018-09-17 08:55:49

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,458
Website

Re: [SOLVED] Txp serving template from different theme than the 1 selected

etc wrote #314078:

So you are still logged in and served the assets from your last working theme, say A, even when viewing section B.

Very true. The preview feature has limitations, especially if using different Page names or, as you say, when using multiple Sections throughout your site. Its primary benefit is when you want to clone an existing design and tweak it ‘live’ without having to worry too much about damaging the experience for existing site viewers while you’re tinkering.

It’s useful if previewing a theme you’ve obtained from someone else, only if its Page names match the ones in use on your live site. That’s why we have a kind of semi-enforced convention that your front page is called default; it makes theme swapping and previewing simpler (at least on the front page) if people stick to the conventions. If you don’t, well, ymmv.

We might introduce two themes fields per section: live theme and dev theme. You could then choose per section which themes are served to visitors/admins.

That’d work and would certainly offer fewer surprises, if we can make sure it’s uncomplicated enough to be of use. However, adding a second theme per section requires a Page and Stylesheet too, so it’s three new database fields, plus whatever admin-side management we need to put in place to support them.

Let’s give this some thought and see if we can figure out the best path.


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

#13 2018-09-17 09:29:49

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

Re: [SOLVED] Txp serving template from different theme than the 1 selected

Bloke wrote #314079:

However, adding a second theme per section requires a Page and Stylesheet too

I don’t see why, this new field would just play the role of skin_editing pref on the public side.

Let’s give this some thought and see if we can figure out the best path.

We do right now :-)


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

Offline

#14 2018-09-17 10:03:15

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: [SOLVED] Txp serving template from different theme than the 1 selected

etc wrote #314082:

I don’t see why, this new field would just play the role of skin_editing pref on the public side.

I guess Stef was thinking about some issue that could appear if the dev theme has no page named as the live selected one.


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#15 2018-09-17 10:20:05

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

Re: [SOLVED] Txp serving template from different theme than the 1 selected

NicolasGraph wrote #314083:

I guess Stef was thinking about some issue that could appear if the dev theme has no page named as the live selected one.

Ah right, they are packaged together, thanks. Ok then, if we add also dev page/style it will be even more flexible: you could use the live theme and change only, say, the style in dev mode. Requires some work, but all ingredients are already there, imo.


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

Offline

#16 2018-09-18 13:30:59

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

Re: [SOLVED] Txp serving template from different theme than the 1 selected

I’ve made some tests, please discuss. If we introduce a fine-tuned dev themes preview, we will be able to set, jointly or separately, sections theme, page and style:

As you see, one could test a new page/stylesheet without creating a new theme.

We would also be able to switch via the multiedit widget public assets to dev (or inversely) when the work is done.


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

Offline

#17 2018-09-18 14:00:04

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,458
Website

Re: [SOLVED] Txp serving template from different theme than the 1 selected

What a great idea! I love the struck-through content as it makes it clear what’s visible to the masses and what’s being overridden by your logged-in status. And the ability to test a second stylesheet or page without creating a new theme is genius. Love it.


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

#18 2018-09-18 21:39:20

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

Re: [SOLVED] Txp serving template from different theme than the 1 selected

Thanks Stef, great if you like it. I will then run more thorough tests and commit it shortly.


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

Offline

#19 2018-09-21 07:04:31

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: [SOLVED] Txp serving template from different theme than the 1 selected

FWIW

etc wrote #314108:

I’ve made some tests, please discuss. […]

FWIW I like it too, but I was not sure about the way it is displayed. I’m now thinking that the use of a line through is disturbing for me; it seems to tell about something removed or broken, not disabled. I would suggest the use of something more consistent with the way the disabled items (I’m thinking about inputs) are styling by default, just making the text ligthter. What do you think?

Edit: here is an example… sorry for the weird names !

Last edited by NicolasGraph (2018-09-21 07:24:06)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#20 2018-09-21 07:25:27

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

Re: [SOLVED] Txp serving template from different theme than the 1 selected

Thanks Nicolas, I get your point. The “overridden” items are wrapped in <del></del> tags but not disabled. I think that’s semantically correct and would leave the styling with admin theme authors.


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

Offline

Board footer

Powered by FluxBB