Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#205 2011-07-19 20:41:47
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,311
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
#206 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
#207 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
#208 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
#209 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
#210 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
#211 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
#212 2011-09-17 02:36:39
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: bot_write_tab_customize: rearrange and style items in the write tab
Ninja-Backflip wrote:
An edited quote from a comment I left at Redbot’s person site. Am I alone in my desire?
Hi Ninja,
I’ll answer with an edited quote from an answer I left to your comment on my site ;)
If I understand correctly your request can be also reformulated this way:
“Can be the item rearrangement tied to the override form dropdown instead of the sections one?”
The answer is yes, but I don’t see any real advantage in doing so. At least for the way I usually organize sites. That said I understand you may find your approach more productive.
If you have some php knowledge you can tweak the plugin to do what you want. If you agree with the method I mentioned before you must replace each reference to the sections dropdown to the “override form” dropdown. This should be not too difficult once you understand how the code works.
Offline
#213 2011-10-04 14:58:59
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,311
Re: bot_write_tab_customize: rearrange and style items in the write tab
Re this issue, i.e. the update problem to 4.4.0/4.4.1:
Notice: Undefined index: $("p:has(select[id*=markup-excerpt])") in /home/ ... /textpattern/lib/txplib_misc.php(653) : eval()'d code on line 323
I’d prefer replacing by hand some values in an SQL export if I needn’t undergo the work of setting up all the rules again, much more error prone and I probably won’t remember all the rules I set up before. Is there a way to convert bot_wtc’s old table’s entries for re-using in the new one?
Last edited by uli (2011-10-04 14:59:54)
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#214 2011-10-05 14:19:35
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,311
Re: bot_write_tab_customize: rearrange and style items in the write tab
Any hints, anyone?
Did somebody find a way to convert the pre-TXP4.3.0 SQL table of bot_wtc so it could be used for TXP 4.4.1?
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#215 2011-10-05 14:56:06
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: bot_write_tab_customize: rearrange and style items in the write tab
uli wrote:
Any hints, anyone?
Did somebody find a way to convert the pre-TXP4.3.0 SQL table of bot_wtc so it could be used for TXP 4.4.1?
Hi Uli,
I’m so sorry I can’t help you now. I’ll try to anwer you asap (not till tomorrow I fear)
Offline
#216 2011-10-05 21:12:01
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,311
Re: bot_write_tab_customize: rearrange and style items in the write tab
Luca, thanks! In the meantime I’ll investigate further, I still can’t say wtc works satisfactorily on my installation. As long as I just hide sections it does its magic, but as soon as I begin hiding custom fields everything’s broken again. Willl try on my local dev, too, and switching SQL tables back and forth, furthermore it might be another incompatibility. Will keep you informed.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline