Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2018-02-24 10:06:55

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: Themes exploring

I think I’m still not getting the switch concept, without exploring it yet, which I can’t do at the mo.

There’s an admin preview context and there’s what to do for when you want the site visitors to see a given theme. What is the latter?

Don’t answer that. I’ll reread and figure it out.

Offline

#14 2018-02-24 11:50:15

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

Re: Themes exploring

Destry wrote #309405:

so it’s not a hard switch, just a faux switch to the admin. (Wonders about other roles.)

Correct. Without the preview ability, we’re not much better off than we were before. You would have to:

  1. Create a fake Section that wasn’t part of your site flow (so it was hidden while you were in development).
  2. Assign a Page/Style from your new Theme to it. But even if you do that, you can’t see the content because articles are assigned to a Section, which isn’t the fake Section you just created.
  3. Decide if you’re going to a) clone articles into this fake Section so you can see them, b) use article_custom to grab them from another section (which means you can’t use pagination), or c) move articles to the fake section (which takes them off the Section they are already assigned and therefore impacts real visitors).

Not great.

So to help ease that and help you to “test” a theme that’s in development without all the upheaval, we conjured up the soft-switch preview concept. Whichever theme you (and only you) are editing, becomes your “working theme”. No matter where you switch:

  • from the Theme selectors on the Pages/Forms/Styles panels; or
  • by clicking an asset count from the columns on the Themes panel; or
  • by clicking a Page or Style name from the columns on the Sections panel

your working theme will be set to that theme: i.e. the one that is currently being edited on the admin side. Any time you view the site from that same browsing session, Textpattern will try to render the site using the working theme instead of the real one that is assigned to the Section you are viewing. Again, this is for you (and you alone). Nobody else is affected whatsoever. Only users who have the ability to administer themes (Publisher (1), Managing Editor (2), and Designer (6)) can do this, btw.

Other admin-side users in the above roles can switch their own working themes to a third, fourth, fifth, … theme if they like, and they’ll see the site previewed in whichever theme they are working on.

Regular punters, who are not logged in to the admin side, will continue to see the site with the ‘official’ theme/page/style that is assigned to the Section they are viewing. They are NOT affected by anybody else’s working theme.

The only time the theme will take effect for real, for all users, is when you assign a Theme/Page/Style combo to one or more Sections form the Sections panel. Once you commit that, the pages are live. Until then, nothing happens as far as site visitors are concerned.

The docs will really need to emphasize the concepts of how switching works, and when, under what contexts. Might even need a clever concept diagram or a custom video demo too.

As an “outsider”, feel free to grab the reins on that as you get to grips with it :-) Docs are on the to-do list so any help you can give would be a massive boon.

One thing we might need in the final release is a pophelp entry alongside the title on the Themes panel itself, like we have on the Forms panel. To give a general overview of what themes are. And what they’re not. Again, any ideas for wording there, stick it in the pophelp repo.

Cheers!


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

#15 2018-02-24 12:22:44

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

Re: Themes exploring

An aside that hopefully won’t muddy the waters…

Before themes came along you could already assign a different Page template (which could ostensibly use a different Stylesheet too) to give the illusion that, say, your home page (default) Section was thematically different to your /blog Section, which was different from your /products Section. Textpattern already gave you this flexibility.

The introduction of themes doesn’t change this. You can still assign a different Page template and a different Stylesheet to one or more Sections. The only difference is that those Pages/Stylesheets may belong to a different collection that you’ve arbitrarily grouped under a Theme because they offer the same sort of look and feel.

It’s all really just smoke and mirrors. Textpattern already had themes, sort of, it’s just there was no structure to them. From 4.7.0, we’ve merely defined this relationship and allowed you to group Pages and Styles and Forms together under the banner of a Theme.

The primary advantage is that we can now map such a “theme” (collection of Pages, Forms and Styles) in the database to a disk-based representation. That allows simple sharing of such collections. So if you thought your CSF layout and styling would be beneficial to others, group all the assets under a single theme, give it a whizzy name, select export from multi-edit and zip up the disk copy, then make it available somewhere.

Others can download that, stick it in their /themes directory, and import it into their database – whereby, remember, it does absolutely nothing.

They can switch their admin-side working copy to it, preview it on their live site. Maybe they like one or two of the Page templates or Stylesheets and think they’d be brilliant for their /blog section. Maybe they don’t like all of them. No problem. They can pick and choose which of the Pages and Stylesheets they employ on any section of the site they like. Just go to the Sections panel, and assign the Pages/Styles there. Done. Live.

Any Page templates and Styles from your theme would remain unused. If they hated them, they could delete them, it doesn’t matter.

The point is, with the introduction of themes, everything changes and nothing changes depending on your viewpoint. If you never visit the Themes panel, you’d be hard pressed to notice any difference in Txp, bar the extra column in the Sections panel. We could have hidden that if there’s only one theme in use, but we kept it visible as a hint.

Even if you add a theme, you don’t have to use the disk thing. You could use it like I do: as a way to make iterative changes to a live site:

  1. Duplicate your current theme.
  2. Make changes to Pages, Forms and Styles in the new theme.
  3. Use the preview feature to see how the changes will look.
  4. When happy, visit the Sections panel and flip the Section assignments to use the Pages and Styles from the new theme.
  5. Optionally delete the original theme and rename the new one to the same name as it was before, ready for the next iteration.

No need for staging servers, development servers, database syncing dances. All changes live. If you have a client who wants to see changes like this you can do the same thing. Heck, give them a suitable login if you like so they can switch to the theme and see the preview “live” for themselves, with their existing content, navigation, everything intact. When they’re happy, you visit the Sections panel and flip the Pages and Styles as normal.

Themes just give you another layer to managing and defining site structure.


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

#16 2018-02-24 12:40:45

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: Themes exploring

Bloke wrote #309407:

The only time the theme will take effect for real, for all users, is when you assign a Theme/Page/Style combo to one or more Sections form the Sections panel. Once you commit that, the pages are live. Until then, nothing happens as far as site visitors are concerned.

Ok. That’s one key nail I needed.

As an “outsider”, feel free to grab the reins on that as you get to grips with it :-)

Gladly. Had to get my head around it all first, and that requires this exchange with the master engineer. ;)

One thing we might need in the final release is a pophelp entry alongside the title on the Themes panel itself, like we have on the Forms panel. To give a general overview of what themes are. And what they’re not. Again, any ideas for wording there, stick it in the pophelp repo.

Noted.

Offline

#17 2018-02-24 12:47:51

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: Themes exploring

Bloke wrote #309408:

You can still assign a different Page template and a different Stylesheet to one or more Sections. The only difference is that those Pages/Stylesheets may belong to a different collection that you’ve arbitrarily grouped under a Theme because they offer the same sort of look and feel … It’s all really just smoke and mirrors. Textpattern already had themes, sort of, it’s just there was no structure to them.

This might be why I was tripping myself. I was imagining some radical new change to doing presentations… A missile-launch console with colored buttons that read “Fire theme 1”, “Fire theme 2”, etc and then watch as the crowd goes Oo! and Aw! at the glorious lightning-filled sky mushroom.

Offline

#18 2018-02-24 12:54:30

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Themes exploring

Just as a note: I’ll be doing the pophelp items for themes panel soon.

Offline

#19 2018-02-24 13:19:56

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: Themes exploring

Okay, Phil.

Meanwhile, can someone point me to where I can find a .txt version of the 4.7dev “default” page markup and the “default” style CSS? I need to start over there so to not screw up the default (Hive) theme. Otherwise I’ll have to start over at the DB/install level, me thinks.

Offline

#20 2018-02-24 13:34:56

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Themes exploring

Offline

#21 2018-02-24 14:02:28

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: Themes exploring

Ya. Thanks.

Offline

#22 2018-02-27 12:43:10

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

Re: Themes exploring

For reference, first pass at a pophelp entry on the Themes panel. Amendments welcome.


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

#23 2018-04-17 06:11:39

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: Themes exploring

I’ve been gradually getting my head around themes, and there’s still more to explore with respect to importing/exporting, which I may never really need to do, in fact.

But I do see now how genius the design of themes is Bloke, and how, for someone like me who changes their mind all the time about site design, and often wants to start over fresh to keep design versions, rather than change existing templates, this is huge. And the simple context switching to see the front-side… I don’t know why I had trouble with grasping that at first, but now that I do, I love it.

Anyway, I just want to say, in case you had any doubts about it, good show, man. It’s sweet work.

Offline

#24 2018-04-17 08:24:21

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

Re: Themes exploring

Destry wrote #311087:

But I do see now how genius the design of themes is

Aww shucks, thanks :-)

the simple context switching to see the front-side… I don’t know why I had trouble with grasping that at first, but now that I do, I love it.

Cool. The thing is, if you didn’t grasp it at first then we need to find out what we can do to help other people over the hump quicker. Whether that’s documentation, UI hints or something else, we’re always open to ideas on how to make it more transparent and easier to pick up. To paraphrase one of my fave quotes: we should help people to hit the ground running, not hit the ground.


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