Textpattern CMS support forum

You are not logged in. Register | Login | Help

#21 2015-06-18 11:26:51

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

Re: Textpattern themes: a plan

Long english treads reading/replying is a hard work for me but I hang on! ‘Hope I’m in…

Bloke wrote #291635:

In what capacity is this theme-related? L10n strings that are used in prefs to control public-side theme usage are going to be handled by smd_prefset. And plugins handle their own strings. So what strings are theme-specific such that they need bundling with a theme?

For exemple, in the theme I’m working on, I’m using smd_lately to display a list of popular articles and I want to display a title like ‘Your favourite articles’. I could hard code it but it’s not the good way for translations…

Images I mentioned in my reply to johnstephens, as I forgot them in the OP.

Maybe. But there are differences that manifest themselves in UI workflow issues:

** (simplest) All plugins still run and are loaded for all themes where their permissions and type apply. Some will be admin-side, some public, some both.
** (more complicated) Change the load_plugins() function to only load plugins that match the current theme, plus any that are NOT assigned to any theme (i.e. the global ones).

Harder is probably better… Maybe we could have two different tables on the Plugins page (or two parts in the existing table with a visual separator) the top one with independant plugins and the second one with the current theme dependant plugins. We wouldn’t need a select menu to switch because it is not necessary to display plugins used by themes you are not using.

OK, I’m not entirely convinced yet (I think this is plugin territory), but let’s explore that anyway. Some prefs, yes. I hadn’t thought of things like comments display modes that do affect the front-end, so that will need thinking about. Good catch. So, firstly, how do you propose this be done in a standard way that make sense for hundreds or thousands of different themes?

About the prefs, on my side I think it would be probably good to have something like smd_prefset in the core. But for other Txp configurations, even if my vision of a theme is cloth to the Sacripant point of view, I think it also depends of the designer work. it is probably better to write a good documentation to let the user know how the theme modify his site and let him do these changes if he is ok.

Yes. Txp will not parse Stylesheets so you’re out of luck there. smd_styles will permit it, but as you say, it’ll be slower. Re-compilation via SASS when you change a pref is possible if SASS is installed on the server.

I learn everyday. Thanks Stef.

That’s up to the plugin, but my guess is that since the directory scheme / zip file structure would be largely based on rah_flat’s mechanism (with just the added “layer” for the theme name), it should be fairly easy to modify the plugin to work seamlessly with themes.

Yes it is totally plugin dependant; I just thought about it…


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

Offline

#22 2015-06-18 11:35:21

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

Re: Textpattern themes: a plan

philwareham wrote #291641:

WordPress uses flat files for themes still with the option of editing them directly within the control panel.

+1


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

Offline

#23 2015-06-18 11:40:44

philwareham
Core designer
From: Farnham, Surrey, UK
Registered: 2009-06-11
Posts: 3,132
Website

Re: Textpattern themes: a plan

If there was a future rah_flat type plugin that allowed flat files with the ability to also edit in the control panel, that would be my top choice for a theme system. i.e.:

Have a theme directory in the root, within that the theme’s directory itself, within that a specific expected directory structure to store pages/forms/css/(theme)images/js/prefs

That would be beautiful. Allows versioning, allows natural browser caching (i.e. CSS and JS as flat files if desired), easy switching between themes. Lovely stuff.

Offline

#24 2015-06-18 11:42:05

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

Re: Textpattern themes: a plan

NicolasGraph wrote #291643:

I want to display a title like ‘Your favourite articles’. I could hard code it but it’s not the good way for translations…

Good example, thanks. I can now see how custom textpack strings could be beneficial as they can be included in templates via txp:text which will automatically reflect the site language. Including .textpack files in the theme package and have them inserted on installation ought to be easy.

Maybe we could have two different tables on the Plugins page (or two parts in the existing table with a visual separator) the top one with independant plugins and the second one with the current theme dependant plugins.

I agree the more difficult approach is better, and that’s one way to visualise it, yeah.

We wouldn’t need a select menu to switch because it is not necessary to display plugins used by themes you are not using.

True, but if you wanted to edit a plugin from a different theme, you might have to go back to the Pages/Forms/Stylesheets panel, select a new theme, then come back to the Admin->Plugins panel just so you can see them. Unexpected hoops.

The fundamental thing is finding a way to visually indicate that a plugin is in two or more installed themes, and allowing people to alter that list.


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

#25 2015-06-18 11:43:17

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

Re: Textpattern themes: a plan

philwareham wrote #291645:

If there was a future rah_flat type plugin that allowed flat files with the ability to also edit in the control panel, that would be my top choice for a theme system. i.e.:

+10000000000000000000000000000000000000001, with that folder structure. That’s pretty much what I listed in my reply to johnstephens above.

We should shoot for that as a long-term goal, maybe even design rah_flat out. I mean, primarily its use is to sync files with the DB isn’t it? Without the DB being involved, is the plugin even needed? Or does it offer other stuff besides?

Last edited by Bloke (2015-06-18 11:46:55)


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

#26 2015-06-18 11:44:02

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

Re: Textpattern themes: a plan

philwareham wrote #291645:

If there was a future rah_flat type plugin that allowed flat files with the ability to also edit in the control panel, that would be my top choice for a theme system. i.e.:

Have a theme directory in the root, within that the theme’s directory itself, within that a specific expected directory structure to store pages/forms/css/(theme)images/js/prefs

That would be beautiful. Allows versioning, allows natural browser caching (i.e. CSS and JS as flat files if desired), easy switching between themes. Lovely stuff.

How would this work exactly? If I edit a form in the Txp UI, are changes saved in the Txp base only or also in the flat files (not sure it’s even possible)?

Have a theme directory in the root, within that the theme’s directory itself, within that a specific expected directory structure to store pages/forms/css/(theme)images/js/prefs

Good. In my themes I use /img for for non content images. It can’t be counfounded with /images.

Last edited by NicolasGraph (2015-06-18 12:03:25)


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

Offline

#27 2015-06-18 11:53:23

philwareham
Core designer
From: Farnham, Surrey, UK
Registered: 2009-06-11
Posts: 3,132
Website

Re: Textpattern themes: a plan

NicolasGraph wrote #291648:

How would this work exactly. If I edit a form in the Txp UI, are changes saved in the Txp base only or also in the flat files?

I guess it would have to mirror the flat file in the database, which some sort of check for changes or a way to sync the two if changes are made outside of control panel (like rah_flat does with the public callback hook URL). Not being a programmer I have no idea if that is even workable – it’s just my dream theme setup.

If database is not needed to store this stuff, then that would also be preferred choice, but I fear that might be a wish too far.

Offline

#28 2015-06-18 11:58:59

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

Re: Textpattern themes: a plan

Bloke wrote #291646:

True, but if you wanted to edit a plugin from a different theme, you might have to go back to the Pages/Forms/Stylesheets panel, select a new theme, then come back to the Admin->Plugins panel just so you can see them. Unexpected hoops.

Ok for a select list and/or we could also have three parts on the same page:

  • Independant plugins;
  • current theme dependant plugins;
  • other theme dependant plugins.

Last edited by NicolasGraph (2015-06-18 12:02:05)


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

Offline

#29 2015-06-18 12:03:00

hcgtv
Plugin Author
From: Miami, Florida
Registered: 2005-11-29
Posts: 2,634
Website

Re: Textpattern themes: a plan

Hi Stef,

Watch out for those ghostly voices ;)

My idea was to provide a mechanism for a newbie to get up and going on TXP quickly by picking from a collection of themes. Freely available HTML templates litter the web, and these templates can be converted to use txp:tags in an afternoon. Simple themes don’t require plugins, and a README would point the user towards any config changes they would need to make. Images and Javascript files, if needed, would remain in the directory tree under the themes directory.

Now if someone has an e-commerce theme they want to sell and it includes the kitchen sink of plugins and preference changes, then they should just package up a complete Textpattern installation if that’s the case.

Simple, baby steps would be preferable than trying to match what somebody like WordPress does, oh the horror!

This was my initial idea for themes: Textpattern Themes

Note the plugins directory, it was to include the hcg_templates plugin that they would need to install to get going. Packaging up plugins with a theme is a bad idea, especially if a theme is packaged up and then sits on a shelf for a period of time and Textpattern is upgraded and plugins are upgraded, you get the quality control dilemma. README: Dear new TxPerson, in order for your theme to work , you need to install txp_floating_menu_with_glitter from the TXP plugins repository.

K.I.S.S.

Edit: The forum thread that started it all, I can’t believe it was 8 years ago.

Last edited by hcgtv (2015-06-18 12:07:24)

Offline

#30 2015-06-18 12:10:48

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

Re: Textpattern themes: a plan

hcgtv wrote #291651:

Note the plugins directory, it was to include the hcg_templates plugin that they would need to install to get going. Packaging up plugins with a theme is a bad idea, especially if a theme is packaged up and then sits on a shelf for a period of time and Textpattern is upgraded and plugins are upgraded, you get the quality control dilemma. README: Dear new TxPerson, in order for your theme to work , you need to install txp_floating_menu_with_glitter from the TXP plugins repository.

Packaging is a way to be sure plugins versions work with the theme, no?

Last edited by NicolasGraph (2015-06-18 12:12:35)


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

Offline

Board footer

Powered by FluxBB