Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-10-04 13:03:48

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

Remove 'Category 1/2' from Write Tab

I use the excellent rss_unlimited_categories plugin, and was wondering how I would go about removing the two obsolete ‘Category x’ labels and drop-downs from the Write tab.

Also, I couldn’t figure out how to enlarge the multiple select categories box that the plugin adds. Help on this would be very much appreciated also.

Offline

#2 2006-10-04 13:18:05

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Remove 'Category 1/2' from Write Tab

That would have to be done by the modifying the plugin rss_unlimited_categories or by creating an additional plugin. I’m privately using a plugin that does this, so it is definitely possible.

To enlarge the selectbox, go to the plugins tab, edit the plugin and look for the number ‘5’ somewhere near the words ‘select’ and ‘option’. That’s what sets the selectbox size. You can change that and press save.

Last edited by ruud (2006-10-04 13:22:48)

Offline

#3 2006-10-04 13:22:33

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

Re: Remove 'Category 1/2' from Write Tab

Thanks, turned out to be on line 515.

Time to delve into the core and try and hack the cat boxes out :¬)

Offline

#4 2006-10-04 13:28:34

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Remove 'Category 1/2' from Write Tab

I’d recommend against hacking TXP core code for this, because it can be done with little effort in the plugin by adding some Javascript that hides the category fields. This is easier when doing TXP upgrades, so you don’t have to redo the changes to TXP core code in the new version.

Wait a sec, I’ll try to find the Javascript I’m using for this… ah, here it is (modified for 4.0.4):

<pre><code>
&lt;script language=“javascript” type=“text/javascript”>
var side = document.getElementById(‘articleside’);
var sels = side.getElementsByTagName(‘select’);
sels0.parentNode.style.display = ‘none’;
sels1.style.display = ‘none’;
var labels = side.getElementsByTagName(‘label’);
labels1.style.display = ‘none’;
var spans = side.getElementsByTagName(‘span’);
spans1.style.display = ‘none’;
&lt;/script>
</code></pre>

I have that in the same plugin I use for unlimited categories, added to the place where all the other Javascript is sent to the browser. Note that this javascript will also need small changes when you upgrade to TXP 4.0.4, but it’s easier than modifying txp core code.

Last edited by ruud (2006-10-04 16:52:15)

Offline

#5 2006-10-04 13:48:52

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

Re: Remove 'Category 1/2' from Write Tab

Thanks!

That removed ‘Category 1’, and its combo, but left Category 2. I added this code to remove the second combo.

<code>document.getElementById(‘category-2’).style.display = ‘none’;</code>

<p>The text ‘Category 2’ still remains, and I can’t figure out how to remove it. Still much better though – thanks a lot.</p>

Offline

#6 2006-10-04 13:55:02

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Remove 'Category 1/2' from Write Tab

Ross, are you using 4.0.4?

Offline

#7 2006-10-04 13:56:30

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

Re: Remove 'Category 1/2' from Write Tab

ruud wrote:

Ross, are you using 4.0.4?

Yes, updated recently.

Offline

#8 2006-10-04 14:54:39

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Remove 'Category 1/2' from Write Tab

updated the code above for 4.0.4 (not tested)

Offline

#9 2006-10-04 14:56:47

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

Re: Remove 'Category 1/2' from Write Tab

ruud wrote:

updated the code above for 4.0.4 (not tested)

I tried that initially, but for some reason it removed both category 2 and the unlimited categories select. Also, I didn’t realise this before, the code works for writing a new article, but backfires when editing an existing one.

I appreciate your help very much still :¬)

Offline

#10 2006-10-04 16:48:02

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Remove 'Category 1/2' from Write Tab

Hmm, so apparently the rss_unlimited select is in the same paragraph tag as the category2 select. Last attempt. See above. Instead of hiding the second paragraph completely, just hide the label, span and select. That should leave what’s left in that paragraph, which is the rss_unlimited select.

Offline

#11 2006-10-04 17:52:25

rossharvey
Member
From: Earth. Sometimes.
Registered: 2005-03-16
Posts: 233
Website

Re: Remove 'Category 1/2' from Write Tab

Category 2 label is still showing, rest has gone :¬)

Offline

#12 2006-10-05 16:49:51

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: Remove 'Category 1/2' from Write Tab

have you tried the plugin ied_hide_admin?
That’d do it for you :)

Last edited by ma_smith (2006-10-05 16:50:55)


Offline

Board footer

Powered by FluxBB