Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2018-02-09 08:32:12

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

Slightly puzzling behavior when updating a theme

STR:
  1. work locally on some pages/forms for an existing theme (in my case not much visible changes, mostly optimizing code)
  2. upload theme to live server (with the version in the manifest.json upped)
  3. on the live server: Themes Panel > select theme in the list. Using the multi-edit widget, select import (note the label really should say update). Import is successful
  4. double check on the Pages and Forms panels that the updated templates are indeed updated (OK). For some reason at that point, I added some HTML comments in those…
  5. Visit front end of site.

Actual result: the pages still use the old templates. Hmm. Ok I had visited some of those before updating, they were in Safari’s cache. I then checked with Firefox (nothing cached there1), but same result.

Expected: pages are rendered with updated page and form templates.

Slightly puzzled.

note: Up-to-date 4.7dev as of time of writing.

1 Firefox is configured to clear all caches / cookies / etc on quit.

Last edited by phiw13 (2018-02-09 08:33:19)


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

Offline

#2 2018-02-09 09:35:33

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

Re: Slightly puzzling behavior when updating a theme

Strange indeed. I followed your steps to the letter as far as I could tell (even adding a comment to the Page template) and my public site rendered the changes on the live site immediately.

The only time the situation you describe should happen is if:

  1. You’re editing theme assets that are not in live use by association with a Section; and
  2. You’re viewing the site from a browser where you’re not logged in to the admin side.

Under those conditions and those alone, you will see the “old” site. Because, until you make the theme live, only you can see the theme in its altered glory while logged in and you’re in the process of editing it.

Behind the scenes: every time you switch theme from the Page/Form/Styles dropdown or by clicking a page/style from the Sections panel, Txp stores a personal cookie that indicates which theme you’re editing. That’s the theme you see in use on the public site when you view it, while you’re logged in, so you can preview what the changes look like. For everyone else, they continue to see the old site until you associate the theme with some sections.

If you’re not seeing this behaviour we need to figure out why.

Last edited by Bloke (2018-02-09 09:37:37)


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 2018-02-09 11:59:59

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

Re: Slightly puzzling behavior when updating a theme

Maybe I was not clear: the theme in use was live the whole time. I just updated through the multi edit widget the template files, which works nicely. So no switching of themes etc.


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

Offline

#4 2018-02-09 14:10:48

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

Re: Slightly puzzling behavior when updating a theme

phiw13 wrote #309160:

the theme in use was live the whole time.

Yep, I got that. Mine was too in my tests. As soon as I imported the altered theme (yeah, updated it: we’ll change the wording!) the changes showed up immediately on the live site. I just added the “theme in use” stuff to explain how it works to others who stumble upon the thread.

Can’t even begin to imagine why you’d see that if there’s no cacheing involved…


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

Board footer

Powered by FluxBB