Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#97 2010-02-15 21:43:02

floodfish
Member
From: Brooklyn, NY
Registered: 2007-01-11
Posts: 155
Website

Re: smd_admin_themes: Manage, edit, switch and share admin-side themes

How can I rename a theme? And/or what’s my best option if I’ve made edits to an existing theme but now want to give my version a new name and keep the original version around with its original name?

Forgive me if this was answered already (if so, I couldn’t find it).

Offline

#98 2010-02-15 22:33:31

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

Re: smd_admin_themes: Manage, edit, switch and share admin-side themes

floodfish wrote:

How can I rename a theme?

Currently it’s a bit involved. Make sure the theme you are intending to rename is not being used, then either:

  1. Export the theme to a zip file
  2. Extract it to your hard drive
  3. Rename the base directory to your_new_theme
  4. Rename the php file to your_new_theme.php
  5. Edit the PHP file and alter class your_old_theme extends classic_theme to class your_new_theme extends classic_theme
  6. Edit the manifest() information as well to suit
  7. Save the changes, rezip the archive from the main directory downward, and upload it via smd_admin_theme’s interface
  8. Delete the old theme from the interface any time after you’ve exported it

OR

  1. Click [Base] of the theme you want to rename (or [Create new theme])
  2. Enter the name of the renamed theme
  3. [Edit] the original, copy the old PHP file contents, switch to the new theme and paste it into the PHP file
  4. Alter the line class your_old_theme extends classic_theme to class your_new_theme extends classic_theme
  5. Save the changes
  6. Copy over the CSS file and upload any graphics again
  7. Delete the old theme at will

You can rename the theme’s PHP file in the [Edit] window but it doesn’t keep the directory name in sync. I think that’s perhaps a plugin failure, and a feature I should add so that if you rename a PHP file it automatically renames the base directory if it can. Hmmm.

I used to have a [Clone] option which would have been useful to you here, but it got sidelined when wet made the theme mechanism class-based. If the auto rename I mentioned above doesn’t work, I suppose I could find some way to [Rename] themes. It’s a bit involved because I have to essentially do parts of the above techniques in code, but it’s probably nothing a few regexes and some skulduggery can’t handle.

Leave it with me and I’ll see what I can do.

Last edited by Bloke (2010-02-15 23:11:57)


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

#99 2010-02-16 00:53:02

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

Re: smd_admin_themes: Manage, edit, switch and share admin-side themes

Scratch my previous post, floodfish. Install v0.22, [Edit] the theme of your choice and before you save the core theme’s PHP file, just alter its name in the upper box. It’ll rename the theme folder as well to keep things in step (thanks for spotting that). Note that it will not change the contents of the PHP file itself so it’s your responsibility to keep the class your_theme extends classic_theme line in sync with the current theme’s folder name. A small price to pay considering this version makes renaming a theme a one-stop process instead of a convoluted series of 7 or 8 steps.


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

#100 2010-02-16 06:08:45

floodfish
Member
From: Brooklyn, NY
Registered: 2007-01-11
Posts: 155
Website

Re: smd_admin_themes: Manage, edit, switch and share admin-side themes

Seems to have worked great! Thanks!

Offline

#101 2010-03-01 00:53:05

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

Re: smd_admin_themes: Manage, edit, switch and share admin-side themes

Maintenance release v0.23 adds no new functionality but it does:

  1. Fix a stupid bug with displaying the wrong export options
  2. Check (if you upload a zip file) that it conforms to the right sort of directory structure

The dir verification is very simplistic and only for .zip file types but it should catch most malformed archives, e.g. ones that don’t ‘start’ at the correct directory level or ones that have a misnamed PHP file inside the archive.

Last edited by Bloke (2010-03-01 00:53: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

#102 2010-08-06 09:28:33

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

Re: smd_admin_themes: Manage, edit, switch and share admin-side themes

Another couple of retarded programming errors fixed in v0.24

  • Shut up the warnings if you’re not connected to the Internet when it tries to get the theme feed from Textgarden
  • Fixed a few ‘undefined index’ warnings if the prefs aren’t installed (happens when running the plugin out of the cache dir)

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

#103 2010-10-21 16:18:34

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: smd_admin_themes: Manage, edit, switch and share admin-side themes

Hi Bloke

I’m not sure if the following is related to my setup, my error, or “other”. . . .

I was having an issue installing Philippe’s new version of sandSpace

As noted in that thread, I now have it installed and working w/ smd_admin_themes, but was never able to upload the zipped file Philippe posted.

In the process I noticed something strange.

  • In several of my themes I had one or more files that had been duplicated with a prefix of “._”
  • When I tried uploading sandSpace as a .tar compressed file, the “._” issue really showed up.
    • The theme directory showed up as expected, but inside ALL the files in the theme duplicated with the prefix of “._”
    • and strangely the compress tar file also showed up with a “._” prefix (at the same directory level as the non-compressed themes)

It seems related to the upload process of smd_admin_themes, but I’m not sure how . . .

some other observations, thoughts, and questions . . . fwiw

  • Would it be difficult to include the version when export a theme ala ied_plugin_composer?
  • Is it difficult to allow multiple image import when authoring a theme?
  • Some theme authors like to include a “read me” file – which doesn’t play nicely with the acceptable file structure (I think?) – would there be any value to making an allowance for a read me/help file?
  • Do the screenshot only show up in the Theme Grid if it is explicitly named “screenshot” as opposed to, say, “sandSpace_screenshot”?
  • By accident I found that if you edit a theme and click the image “upload” w/ no file selected, it creates what appears to be two instances of the plugin edit page . . . . on the same page. Kinda of strange.
  • I thought several times as I was editing a theme how convenient it was to be able to manage the images, js, css, and php files all from one unified interface. And my thoughts wondered to managing front end templates in a similar way. . . . :D

fwiw, and thanks for a sweet plugin!

Mike

Offline

#104 2010-10-24 03:34:16

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

Re: smd_admin_themes: Manage, edit, switch and share admin-side themes

maverick wrote:

In several of my themes I had one or more files that had been duplicated with a prefix of “._”

Isn’t this a Mac thing? I think the resource fork is automatically included. Not usually a problem on Mac as it’s hidden, but on Windows it shows up as an extra directory. Perhaps I should explicitly ignore this type of directory but I’m not sure if that has any repurcussions in Mac land? (I’m not the world’s most Macliterate person). Perhaps someone else can shed some light on this and I can improve the plugin.

Would it be difficult to include the version when export a theme ala ied_plugin_composer?

Not difficult. I omitted it because version numbers might get in the way and since upgrades can be handled fairly seamlessly from the plugin by clicking on any highlighted version number I felt the file name wasn’t that important. Maybe I was wrong. What does everyone else think?

Is it difficult to allow multiple image import when authoring a theme?

Probably not difficult, but requires thought. It’s on the TODO list, just need to make some time for it.

Some theme authors like to include a “read me” file – which doesn’t play nicely with the acceptable file structure (I think?) – would there be any value to making an allowance for a read me/help file?

From memory I think readme files and instructions.txt or whatever are acceptable files. Stuart flagged this ages ago and I’m pretty sure I made allowances. But maybe I missed some use cases. I’ll check out sandSpace and see what’s in there, but if there are any other specific filename exceptions/conventions you can think of then I’ll consider adding them or relaxing the rules a little.

Do the screenshot only show up in the Theme Grid if it is explicitly named “screenshot” as opposed to, say, “sandSpace_screenshot”?

Yes. It’s in the admin themes spec that screenshots should be named screenshot.[jpg|png|gif]. That’s simply the shot used in the admin theme’s tab. Multiple or alternate screenies are permitted, though only one can be displayed on the tab and the name is pretty inflexible.

By accident I found that if you edit a theme and click the image “upload” w/ no file selected, it creates what appears to be two instances of the plugin edit page . . . . on the same page. Kinda of strange.

Probably a bug. I have a new version that works better under more varied themes ready to go. I’ll try and investigate this and sneak a fix in for ya before I release the next version. Thanks for the report.

I thought several times as I was editing a theme how convenient it was to be able to manage the images, js, css, and php files all from one unified interface. And my thoughts wondered to managing front end templates in a similar way. . . . :D

Be careful what you wish for. You just never know… :-D


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

#105 2010-10-24 12:07:03

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

Re: smd_admin_themes: Manage, edit, switch and share admin-side themes

Bloke wrote:

Some theme authors like to include a “read me” file – which doesn’t play nicely with the acceptable file structure (I think?) – would there be any value to making an allowance for a read me/help file?

From memory I think readme files and instructions.txt or whatever are acceptable files. Stuart flagged this ages ago and I’m pretty sure I made allowances. But maybe I missed some use cases. I’ll check out sandSpace and see what’s in there, but if there are any other specific filename exceptions/conventions you can think of then I’ll consider adding them or relaxing the rules a little.

There is actually nothing special in Sandspace, the zipped structure was a bit unexpected for smd_admin_themes.

phw_sandspace.zip
      |- readme.txt
      |- sandspace
            |- screenshot
            |- sandspace.css
            |- sandspace.min.css <!-- in use -->
            |- sandspace.php
            |- images....
            |- js

I’ll make sure I have the expected structure when I push the final release out.

——-

And my thoughts wondered to managing front end templates in a similar way. . . . :D

hmmm ……….. :?:-D ?


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

Offline

#106 2010-10-24 13:19:01

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: smd_admin_themes: Manage, edit, switch and share admin-side themes

I’ve only got a second right now, but while it is on my mind –

would it be useful if the readme.txt could be included in the package like the other php, js, and css files?(or maybe it already can? I’ve didn’t try that)

Offline

#107 2010-10-24 13:29:31

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

Re: smd_admin_themes: Manage, edit, switch and share admin-side themes

maverick wrote:

would it be useful if the readme.txt could be included in the package like the other php, js, and css files?(or maybe it already can? I’ve didn’t try that)

I did try that and it works as I would expect. The readme shows up under ‘others’ in the list of files for a theme.


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

Offline

#108 2010-11-01 22:05:02

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

Re: smd_admin_themes: Manage, edit, switch and share admin-side themes

Maintenance release v0.25 is available. Features:

  • Better theme integration (less hard-coded style rules, allowing the installed theme to show through) — thanks thebombsite
  • Export file format is now a preference — and can include version if you wish — thanks maverick
  • Fixed empty upload image bug on Edit screen — thanks maverick

Many thanks to those who found bugs and offered advice on improvements. More on the way when I get time.

Last edited by Bloke (2010-11-01 22:05:33)


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