Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Archives
  3. » [archived] waz_admin_hide_fields

#1 2005-05-08 08:00:47

wazdog
Archived Plugin Author
From: Japan
Registered: 2004-05-26
Posts: 11

[archived] waz_admin_hide_fields

Notice: This thread is archived, this plugin is no longer available.

**********************************************************

Name: waz_admin_hide_fields
Author: Joshua Jabbour
Created: 2005-05-08
Modified: 2005-05-09
Version: 0.1 0.2 0.2.1 0.3
Download: waz_admin_hide_fields No longer available from this source

The plugin requires Rev. 198 or later which is when admin-side plugin support was added.

This plugin is still in an experimental state. Buyer beware and all. You’ve been warned!

This plugin allows you to hide fields from the “Write Article” page. (I’ve used it to hide the “Use Textile” and “Keywords” sections so as to not confuse the guy for whom I’m designing a Textpattern-powered site.)

Currently, you must edit the source of the plugin to specify which fields to hide. Hopefully I will add a preference page for the plugin soon, but for now, this will have to do. (It’s better than hacking the Textpattern code.)

In order to hide a field, change “1” to “0” in the array at the top of the plugin code. Do this by clicking “edit” on the plugins page. Do not change the names in this array, or the plugin will not work.

Note: Should now work for all languages. This plugin currently only works for the English (GB) and English (US) locales. Another thing I hope to remedy soon. Until then, you can do a little more editing to make it work for your locale. Just change the names in the array at the top to what is displayed in your language. Do not change the names in the array, or the plugin will not work.

Changelog:

0.3
Added the ability to hide a few more fields.
Locale support: Plugin should work no matter which language Textpattern is set to use.

0.2.1
Added “Recent Articles” link to the list of fields that can be hidden.

0.2
Users no longer have to manually type the names of fields they want hidden. Just set the preference to “0” for fields desired hidden. The source must still be edited though.

0.1
Initial release

Last edited by wazdog (2006-02-03 04:41:05)

Offline

#2 2005-05-08 08:02:44

chrisrhee
Member
Registered: 2004-07-01
Posts: 33
Website

Re: [archived] waz_admin_hide_fields

Haha, wow, I just went through and hacked up the TXP code to do this. I’ll have to try this out later. Thanks.

Offline

#3 2005-05-08 16:31:11

soulship
Member
From: Always Sunny Charleston
Registered: 2004-04-30
Posts: 669
Website

Re: [archived] waz_admin_hide_fields

This is fantastic! Thanks!

Offline

#4 2005-05-09 08:05:10

wazdog
Archived Plugin Author
From: Japan
Registered: 2004-05-26
Posts: 11

Re: [archived] waz_admin_hide_fields

If anyone tries this out, please report back any errors. I haven’t tested in any PC browsers, nor Mac IE.

The plugin uses fairly basic Javascript Regular Expression support, but supposedly each browser implements RegEx’s a little differently. Surprise, surprise.

Offline

#5 2005-05-09 11:14:46

wazdog
Archived Plugin Author
From: Japan
Registered: 2004-05-26
Posts: 11

Re: [archived] waz_admin_hide_fields

Something weird has happened with this latest version. When the plugin is enabled, the text in the Body form textarea has strange linebreaks. It gets saved correctly, but just appears malformed.

I’d recommend not using this plugin until I can work out what the kink is.

Or try it, and see if you can find the bug. :)

Last edited by wazdog (2005-05-09 11:15:12)

Offline

#6 2005-05-09 12:37:04

alice_c
Plugin Author
From: Karlsruhe, Germany
Registered: 2004-07-03
Posts: 33

Re: [archived] waz_admin_hide_fields

The plugin works like charme under firefox/win. But on Apple there are strange behaviours: on Safari 1.3 the plugin has no effect, the fields are still there. On Safari 1.2.4 the textarea in the middle is completly missing (as reported by my customer, haven’t seen it myself).

Last edited by alice_c (2005-05-09 12:37:24)

Offline

#7 2005-05-09 12:41:28

wazdog
Archived Plugin Author
From: Japan
Registered: 2004-05-26
Posts: 11

Re: [archived] waz_admin_hide_fields

That’s strange, it seemed to work in Safari 2.0.

Let me check again…

Offline

#8 2005-05-09 14:00:22

wazdog
Archived Plugin Author
From: Japan
Registered: 2004-05-26
Posts: 11

Re: [archived] waz_admin_hide_fields

OK, the new version (0.3) doesn’t work in Safari at all. This is because Safari doesn’t support callbacks in Javascript RegExp parsing. Which is what I used to make the script work for any localisation. (You can still download the 0.2.1 version and use it if you need to use Safari.)

As for my problems with strange formatting on the Body textarea in Firefox, I have no idea. Well, I have sortof an idea, but I’m not sure if it’s work-aroundable. And I have no idea how to find out more about it. So it may derail the plugin for now.

I have another idea how this can be handled way easier, so I may submit a small patch for the Txp core…

Offline

#9 2005-05-09 14:48:19

wazdog
Archived Plugin Author
From: Japan
Registered: 2004-05-26
Posts: 11

Re: [archived] waz_admin_hide_fields

Okay, I’ve changed the core Txp code to allow stuff like this super-easily. Just added a bunch of id’s where needed. (I’m a big fan of CSS.)

This solves every problem reported, and probably every one not reported. ;)

Anyway, I have a patch file. Don’t know if Dean or the devs would accept it and roll it into the core (it wouldn’t have any negative effect). But I went to the development Trac site, and couldn’t find out how to create a login identity, so I can’t submit a ticket. :(

Anyway, I don’t really have the time to do much more here. I’ll just have to use a hacked up Txp install for my site, and hope I can get my small changes added to Txp soon…

Last edited by wazdog (2005-05-09 14:49:39)

Offline

#10 2005-05-09 15:32:15

soulship
Member
From: Always Sunny Charleston
Registered: 2004-04-30
Posts: 669
Website

Re: [archived] waz_admin_hide_fields

Are you going to post the code change somewhere? I for one would still like to play around with it.

Offline

#11 2005-05-10 03:03:51

alicson
Member
Registered: 2004-05-26
Posts: 465
Website

Re: [archived] waz_admin_hide_fields

Joshua, did you drop an email to Dean about this (since you can’t get into Trac)? would be a very nice addition/change to the core, I think.


textpattern.org :: find and share Textpattern resources
docs.textpattern.io :: Textpattern user documentation

Offline

#12 2005-05-10 03:09:07

wazdog
Archived Plugin Author
From: Japan
Registered: 2004-05-26
Posts: 11

Re: [archived] waz_admin_hide_fields

> alicson wrote:

> Joshua, did you drop an email to Dean about this (since you can’t get into Trac)? would be a very nice addition/change to the core, I think.

No, I didn’t have a chance yet. I spent way to long turning my original hacks into a plugin (it was fun though), and now am behind on the site I was doing this for. :)

I’ll drop him a note tonight, though. As I said, it’s a quick change…

I’ll also try to post my changes to the core here, in case you want to do the hacking yourself.

cheers,
j

Offline

  1. Index
  2. » Archives
  3. » [archived] waz_admin_hide_fields

Board footer

Powered by FluxBB