Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2018-09-14 22:08:05

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 981
Website

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

Today I upgraded one of the most complex sites I operate from Textpattern 4.6.2 to 4.7.1.

After the upgrade, I copied and exported the default theme, so I could make some template changes. After making the changes, I imported the copied theme, and changed the section to use that theme instead.

But after reloading the page multiple times, checking and rechecking the Theme and Section settings, and doing some manual testing in the Forms panel, I found that Textpattern was still serving a certain form from the default theme instead of the copy.

I finally resolved the problem by deleting the default theme in Textpattern. After that, Textpattern loaded the form from the selected theme, and I could see there was a tag error on the page. My impression was Textpattern was automatically redirecting the request to the default theme when it ran into the tag error, instead of showing me the error so I could fix it.

But there was no message on the front end or in Textpattern about why Textpattern was showing the form from the wrong theme, and my server logs didn’t show any errors either. This is just a report, in case you find it useful to add some kind of warning in Textpattern when this happens.

But I also wanted to post here in case I do the same thing again one day and I can’t remember—maybe Google will find it for me. ;)

Offline

#2 2018-09-15 07:49:43

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 3,159
Website

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

Could that have something to do with your site status and you being logged in or not?

If you check the intro post on themes on textpattern.com, there’s a description of how the themes capability allows you to edit without affecting the live site until you are ready. As I routinely use etc_flat to work on templates, which requires its own deliberate syncing to make live, I’ve forgotten exactly how that works.

If, on the other hand, your observations show that a theme is automatically sourcing default forms (i.e. when the form / list_form attribute is not specified) from another theme than the one selected, that might be a potential bug.


TXP Builders – finely-crafted code, design and txp

Offline

#3 2018-09-15 09:53:34

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

I admit this is potentially a confusing element to the themes system and I’m interested to know if there’s a way we can make this behaviour more obvious, e.g. perhaps by displaying something on the admin-side about what theme is currently “in force” for the current user. The fact that the pages/forms/styles panels show this by virtue of the Theme dropdown is fine, but if you’re beavering away on other panels, you might not notice this.

I do, however, think that the ability to preview site changes on the fly to logged-in users is worth keeping because the alternative is:

  1. Going through the pain of making fake sections in which to assign your new theme assets, and moving content into them or making dummy content.
  2. Making an entire staging site and then having to worry about how to sync the databases on go-live.

That’s faff I’m convinced we can do without.


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

#4 2018-09-15 12:03:58

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

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

Bloke wrote #314049:

I’m interested to know if there’s a way we can make this behaviour more obvious, e.g. perhaps by displaying something on the admin-side about what theme is currently “in force” for the current user.

I even think that this “something” should be displayed for admin users on the public side, each time his theme is different from the public one.

I do, however, think that the ability to preview site changes on the fly to logged-in users is worth keeping

absolutely!


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

Offline

#5 2018-09-15 17:13:52

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 #314052:

this “something” should be displayed for admin users on the public side, each time his theme is different from the public one.

That’s a neat idea. Like something overlaid in the corner or along the bottom edge?

It would probably need to be session-based and dismissable for the session or until the theme is changed again, in case the site in question is being tested on a mobile device. Don’t want precious real estate taken up by something permanent, imo.


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 2018-09-15 17:26:21

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 6,911
Website

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

Bloke wrote #314053:

Don’t want precious real estate taken up by something permanent, imo.

+1


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github

Offline

#7 2018-09-15 20:06:30

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

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

Bloke wrote #314053:

It would probably need to be session-based and dismissable for the session or until the theme is changed again, in case the site in question is being tested on a mobile device. Don’t want precious real estate taken up by something permanent, imo.

Oh, it could be just a 3 seconds unobtrusive reminder with pointer-events:none in non-live mode. If we must complicate it further, something better could probably be found.


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

Offline

#8 2018-09-16 09:08:20

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 #314055:

it could be just a 3 seconds unobtrusive reminder with pointer-events:none in non-live mode.

That’d certainly do.


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 2018-09-16 21:41:26

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

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

On the second thought, you’ll be mislead by this “live” dev preview every time your site is using more than one theme at once. That’s not ideal and not ideal is not txp. We should probably delegate this feature to some explicitly “sandboxed” view.


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

Offline

#10 2018-09-17 07:34:44

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 #314069:

On the second thought, you’ll be mislead by this “live” dev preview every time your site is using more than one theme at once. That’s not ideal and not ideal is not txp. We should probably delegate this feature to some explicitly “sandboxed” view.

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


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

Offline

Board footer

Powered by FluxBB