Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#205 2011-06-02 14:22:18
Re: bot_write_tab_customize: rearrange and style items in the write tab
redbot, i’m pretty sure the error occurred after upgrading from 4.2, so i guess it’s like you said.
cheers!
-f
Offline
#206 2011-07-06 17:23:18
- M_i
- Member
- Registered: 2006-03-05
- Posts: 122
Re: bot_write_tab_customize: rearrange and style items in the write tab
I’m idiot-proofing a site, and looking for a way to hide certain categories per section. So for example, for section A, I only want to show categories 1 and 2, while for section B, I want to show categories 3 and 4, and for section C I want to hide categories altogether.
The last can be easily achieved with this plugin; would it be possible to hide a selection of categories via a javascript?
Any help would be appreciated — and of course many thanks for this brilliant plugin!
-iris
Offline
#207 2011-07-06 19:04:41
Re: bot_write_tab_customize: rearrange and style items in the write tab
M_i wrote:
I’m idiot-proofing a site, and looking for a way to hide certain categories per section.
We love redbot :D
BTW: redbot, you should add this one to your site /+ textpattern.org
Offline
#208 2011-07-06 19:27:42
- M_i
- Member
- Registered: 2006-03-05
- Posts: 122
Re: bot_write_tab_customize: rearrange and style items in the write tab
THE BLUE DRAGON wrote:
We love redbot :D
That’s perfect! That is exactly what I was looking for! Thanks a lot! And indeed, we love redbot! (and textpattern, too!)
Last edited by M_i (2011-07-06 19:27:57)
Offline
#209 2011-07-19 19:50:09
Re: bot_write_tab_customize: rearrange and style items in the write tab
I was hoping to hide some custom fields depending on which category is selected from the category1 select dropdown.
Something like:
psuedo code
if *pizza* selected from *category1 dropdown menu* show custom fields *small-price*, *medium-price*, *large-price*
This way I can show/hide all the many varied prices per each menu category (pizza, pasta, etc…).
Am I write in assuming I can add some js to the Additional js code box and write some show and hide classes in textattern.css? If so, I’m not quite sure how to figure out how to write that javascript as my brain is running on one cylinder this week.
txtstrap (Textpattern + Twitter Bootstrap + etc…)
Offline
#210 2011-07-19 20:41:47
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,306
Re: bot_write_tab_customize: rearrange and style items in the write tab
Josh, not exactly tailor made but it could help you, hopefully. The below is taken from the Write tab and should cover the relevant parts (I tried on a local text file). Just replace if (value=="badlands"){
(etc.) with your category list items and replace my custom fields and stuff with yours.
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$("#advanced").show();
$("select#category-1.list").change(function(){
$(".category-2").show();
$("p:has(*[name=custom_3])").show();
$("p:has(*[name=custom_2])").show();
$("p:has(*[name=custom_1])").show();
$("#custom_field_group").show();
$("p:has(*[name=custom_4])").show();
$(".category-1").show();
$("p:has(*[name=custom_11])").show();
$(".body").show();
$(".excerpt").show();
$("#article-tabs").show();
var value = $("select#category-1.list").val();
if (value=="badlands"){
$(".category-2").hide();
$("p:has(*[name=custom_3])").hide();
$("p:has(*[name=custom_2])").hide();
$("p:has(*[name=custom_1])").hide();
$("#custom_field_group").hide();
$("p:has(*[name=custom_4])").hide();
$(".category-1").hide();
$("p:has(*[name=custom_11])").hide();
}
if (value=="bonpland"){
$(".category-2").hide();
$(".body").hide();
$(".excerpt").hide();
$("#article-tabs").hide();
}
if (value=="playground"){
$(".category-2").hide();
$("p:has(*[name=custom_3])").hide();
$("p:has(*[name=custom_2])").hide();
$("p:has(*[name=custom_1])").hide();
$("#custom_field_group").hide();
$("p:has(*[name=custom_4])").hide();
$(".category-1").hide();
$("p:has(*[name=custom_11])").hide();
}
if (value=="institute of science"){
$(".category-2").hide();
$("p:has(*[name=custom_3])").hide();
$("p:has(*[name=custom_2])").hide();
$("p:has(*[name=custom_1])").hide();
$("#custom_field_group").hide();
$("p:has(*[name=custom_4])").hide();
$(".category-1").hide();
$("p:has(*[name=custom_11])").hide();
}
}).change();
});
</script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$("select#category-1.list option:not(:selected)[value=default]").remove();
$("select#category-1.list option:not(:selected)[value=search]").remove();
});
</script>
No idea what the last script is needed for. Obviously concerns the section list dropdown.
Good luck!
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#211 2011-07-19 20:52:26
Re: bot_write_tab_customize: rearrange and style items in the write tab
Thanks Uli!
That is the magic I needed. I really appreciate you taking the time to share that.
txtstrap (Textpattern + Twitter Bootstrap + etc…)
Offline
#212 2011-09-08 00:13:21
Re: bot_write_tab_customize: rearrange and style items in the write tab
I’m experiencing a problem with this plugin. It throws a js error and refuses to hide any of the fields.
uncaught exception: Syntax error, unrecognized expression: [name=custom_31[]]
when I look at the source I see this peculiarity…
$("p:has(*[name=custom_31[]])").hide();
I’m using glz and I have about 32 cfs. Using 4.4.0 and 4.4.1 on some sites. I tend to rely on this plugin so I’m hoping to resolve the issue.
Offline
#213 2011-09-08 07:49:15
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: bot_write_tab_customize: rearrange and style items in the write tab
Offline
#214 2011-09-08 16:03:36
Re: bot_write_tab_customize: rearrange and style items in the write tab
redbot wrote: see here to fix it
I actually did that, but no wit refuses to hide checkbox and multiselect CFs
It did solve a longstanding problem though.
Offline
#215 2011-09-08 17:58:11
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: bot_write_tab_customize: rearrange and style items in the write tab
mrdale wrote:
I actually did that, but no wit refuses to hide checkbox and multiselect CFs
just to be sure did you read two posts later?
Edit: maybe it has to do with the latest version of glz_custom. I’ll have a look when I can
Last edited by redbot (2011-09-08 17:59:44)
Offline
#216 2011-09-16 23:32:14
- Ninja-Backflip
- Member
- From: England
- Registered: 2011-02-22
- Posts: 14
Re: bot_write_tab_customize: rearrange and style items in the write tab
An edited quote from a comment I left at Redbot’s person site. Am I alone in my desire?
“ Would the plugin be more flexible if it wasn’t tied to the write tab’s section drop-down? I think if the plugin created it’s own user defined select list in the write tab area, it would free up sections for taxonomy purposes.
An example –
> I use the ‘amended’ plugin (and glz Custom Fields) to rearrange the write tab to accommodate an easy video upload interface.
> In the plugin options panel, rather than associating / saving this configuration to a TXP section, I create a name / title for it. i.e Video
> When I go to the write tab, I see in one of the columns a new select list that lets me choose ‘video’. When I select it, the write page rearranges according to how I set it up.
> Now I can evoke the newly arranged write panel regardless of what section I want to place the article in.
If this was possible, TXP would truly be one huge leap closer to Custom Content Types. It would also be handy if the ‘amended’ plugin created a new <txp:tag> called, lets be frivolous, <txp:content-type name=“video”> that could call all articles created under that write tab configuration.”
Offline