Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2015-05-12 14:59:39

sacripant
Plugin Author
From: Rhône — France
Registered: 2008-06-01
Posts: 479
Website

Textpattern update best praticies

Hello Txp users,

Today I updated a site to Textpattern 4.5.7 and it always asks me some manual interventions.
Specially in 2 points and I would like your tips if you have :

1- Custom CSS for Admin theme

I add a custom CSS file for modify back office (hide some part, change custom field design, etc.)
For that, I add a line to hive.php

line 12 :

	$out[] = '<link href="'.$this->url.'css/custom.css" rel="stylesheet" type="text/css" />';

But it’s a hack, and each time I make a update, I loose this modification.

What is your clean solution for adding custom CSS to admin theme ?

2- User permission in admin_config

Same probleme for defining specific users permissions : I hack admin_config file and loose this in each update.
And same question, have you a better practice for this ?

Thanks

Offline

#2 2015-05-12 21:20:25

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,578
Website

Re: Textpattern update best praticies

I think you can do both using other means:

1) make your own admin theme:

  • duplicate the textpattern/theme/hive folder and give the folder a new name (e.g. sacripantadmin).
  • Rename hive.php to the same as your folder name (e.g. sacripantadmin.php).
  • Open that php file and change class hive_theme extends theme to your new name and at the bottom of that file, update function manifest to match your new theme name.
  • Now sign in to the admin area and in the advanced prefs switch from hive to sacripantadmin.

You can now edit the css for that theme to your heart’s content. You just need to remember to save the theme before you upgrade. If you don’t want to go the custom admin theme route, hpw_admin_css will do very much what you’ve done with your mod.

2) Use bot_privs, which gives you an admin pane where you can edit the admin privs using a GUI. rah_privileges might do the same, but I’ve not tested that.


TXP Builders – finely-crafted code, design and txp

Offline

#3 2015-05-12 23:53:55

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

Re: Textpattern update best praticies

As you know, never a great idea to modify core files. Look at this sample to extend the default Hive theme with your own stylesheet (and js if needed).

(of course, once TXP 4.6 comes out, you’ll probably need to change your own stylesheet).


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

Offline

#4 2015-05-13 01:30:10

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: Textpattern update best praticies

jakob wrote #290697:

rah_privileges might do the same, but I’ve not tested that.

Does anyone have experience with this plug-in? I installed and enabled it, but there is no entry in the extensions subnav, Textpattern 4.5.7 and PHP 5.5.19.

Offline

#5 2015-05-13 02:16:24

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

Re: Textpattern update best praticies

GugUser wrote #290701:

Does anyone have experience with this plug-in? I installed and enabled it, but there is no entry in the extensions subnav, Textpattern 4.5.7 and PHP 5.5.19.

Look at Preferences > advanced.

(sadly, it doesn’t seem to work on the 4.6 branch, which is what I have installed locally to play with things).


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

Offline

#6 2015-05-13 04:26:10

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: Textpattern update best praticies

phiw13 wrote #290702:

Look at Preferences > advanced.

Oh, yes, thank you.

Offline

#7 2015-05-13 16:22:18

sacripant
Plugin Author
From: Rhône — France
Registered: 2008-06-01
Posts: 479
Website

Re: Textpattern update best praticies

Thanks for your tips.

For custom admin CSS, I’ll look to add my own custom admin theme for extend Hive. It’s a core solution. Good. But as written Phiw13, TXP 4.6 make change to hive theme, it will rewrite all custom css for every maintened site after the migration.

For second point (custom user permissions), there still no solution in core yet. I think it’s a big missing feature! I will look rah_privileges (I think bot_plugins are orphans now).

Offline

#8 2015-05-13 16:26:00

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: Textpattern update best praticies

bot_privs works in Textpattern 4.5.7.

Offline

#9 2015-05-14 03:38:40

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Textpattern update best praticies

phiw13 wrote #290702:

(sadly, it doesn’t seem to work on the 4.6 branch, which is what I have installed locally to play with things).

The plugin itself does work; the registered privileges item name was just wrong. I’ll build an update release in sometime future.

Offline

#10 2016-06-13 13:53:49

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,303

Re: Textpattern update best praticies

Thomas, dreams can come true (see that post and the following ones).


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

Board footer

Powered by FluxBB