Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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
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
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
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>
<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’;
</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
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
Re: Remove 'Category 1/2' from Write Tab
Ross, are you using 4.0.4?
Offline
Re: Remove 'Category 1/2' from Write Tab
ruud wrote:
Ross, are you using 4.0.4?
Yes, updated recently.
Offline
Re: Remove 'Category 1/2' from Write Tab
updated the code above for 4.0.4 (not tested)
Offline
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
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
Re: Remove 'Category 1/2' from Write Tab
Category 2 label is still showing, rest has gone :¬)
Offline
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)
- I am Squared Eye and I
am launchinghave launched Pattern Tap
Offline