Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#73 2010-01-29 17:33:29

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: bot_write_tab_customize: rearrange and style items in the write tab

mlarino wrote:

The “Extras” custom_field is a list of checkboxes, too long, so i wanted to be able to hide it, or show depending on the need.

Actually checkboxes are the most difficult type of custom fields to apply this effect because every checkbox is wrapped in a span. Anyway in this case you can try this

<script type="text/javascript">  $(document).ready(function() { $(".collapse label:first").click(function(){ $(this).parent().find("span").slideToggle(); }); }); </script>

It’s not elegant at all and tries to achieve the result in a sloppy way. Anyway stay assured that there is a better way to do it (thanks to jquery); if I find some time and have a better idea I’ll post here.

P.S. Given the ecaping issues you were having before, remember to prepend “\” to each double quote in the code I posted

Offline

#74 2010-01-29 19:14:17

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: bot_write_tab_customize: rearrange and style items in the write tab

mlarino wrote:

I am having problems inserting JS in the plugin, I am getting this warning:

Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'text/javascript"> $(document).ready(function() { $(".collapse").click' at line 1 update txp_prefs set val= "", html="textarea" where name = "bot_wtc_script" in /home/sites/mlarino.com/public_html/asesoria/textpattern/lib/txplib_db.php on line 113

Hi again,
Regarding this issue you were perfectly right: this is really a naive error on my side (didn’t take in account if magic quotes were enabled or not) and I’ll fix it in the next release. Thank you for noticing!
As for the collapsible checkboxes you actually discovered a little issue with glz_custom. I’ll ask Gerhard to make glz_custom output a more manageable html for checkboxes.

Last edited by redbot (2010-01-29 19:18:24)

Offline

#75 2010-01-30 02:57:45

whaleen
Member
From: Portland
Registered: 2006-05-11
Posts: 373
Website

Re: bot_write_tab_customize: rearrange and style items in the write tab

redbot wrote:

you can achieve what you want adding some lines of jquery in the “additional js code” field. I can’t help you now but a similar – though simpler – request has already been answered here. The principle should be the same: first add the same class to items you want to expand/collapse together (for example .toggle1 for cf1 +cf2 and .toggle 2 for cf3+cf4) and then – through jquery – add somewhere in your “write” tab one or more texts or links or buttons which trigger the expand/collapse behaviour.

Thank you. I will take this as yet another prompt to lean more javascript and how the txp admin area is made up. :) Great plugin, as are your others. I’ve never been so close to having the ideal setup for clients. Fantastic! IMHO this should be txp core bound. Once it’s idiot proof to use of course. Maybe it would exist in a new sub-section of advanced prefs… Just a thought.


txtstrap (Textpattern + Twitter Bootstrap + etc…)

Offline

#76 2010-01-30 22:39:34

jan
Member
From: Utrecht, The Netherlands
Registered: 2006-08-31
Posts: 71
Website

Re: bot_write_tab_customize: rearrange and style items in the write tab

Wow, this plugin is amazing!
I can do everything I used to hack txp_article.php for :)

Custom javascript box comes in very handy for some manual tweaks.

Good job redbot!


Kensington TXP powered rock

Offline

#77 2010-01-30 23:09:53

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: bot_write_tab_customize: rearrange and style items in the write tab

Running into this problem…

After 13 custom fields have been hidden when I click “update” it dumps me back into the articles page.

Weird… any ideas?

Offline

#78 2010-01-31 16:14:26

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:

…fter 13 custom fields have been hidden when I click “update” it dumps me back into the articles page. Weird… any ideas?

Damn! Just when I thought I fixed all the bugs ;)
It looks really mysterious to me. I tried to replicate this behaviour with no success and I can’t imagine what can be causing it…
Can anyone confirm this while I try to find a possible reason?

Offline

#79 2010-01-31 18:59:17

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: bot_write_tab_customize: rearrange and style items in the write tab

redbot wrote: Damn! Just when I thought I fixed all the bugs ;)

email me for a site login if you like.

Offline

#80 2010-01-31 19:56:55

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:

email me for a site login if you like.

Hi Dale,
yes I ‘d like to have a look but I see no mail link.
If you want you can send me address and login info using my email link (which should be visible).
Thank you.

Offline

#81 2010-02-01 08:25:21

mlarino
Member
Registered: 2007-06-29
Posts: 367

Re: bot_write_tab_customize: rearrange and style items in the write tab

redbot wrote:

Regarding this issue you were perfectly right: this is really a naive error on my side (didn’t take in account if magic quotes were enabled or not) and I’ll fix it in the next release. Thank you for noticing!
As for the collapsible checkboxes you actually discovered a little issue with glz_custom. I’ll ask Gerhard to make glz_custom output a more manageable html for checkboxes.

I wouldnt say I noticed, My knowledge doesnt go that far :)
But thanks!

Offline

#82 2010-02-06 04:57:38

floodfish
Member
From: Brooklyn, NY
Registered: 2007-01-11
Posts: 155
Website

Re: bot_write_tab_customize: rearrange and style items in the write tab

Just installed this and really liking it!

The hide-by-sections isn’t working for me at all though. This should make a given field disappear when editing an article in a checked section, correct?

I can’t seem to get it to do that, or indeed anything else.

edit: “Hide sections in sections dropdown” isn’t working either. The selected sections still show up on the article write/edit page.

Last edited by floodfish (2010-02-06 05:09:01)

Offline

#83 2010-02-17 19:21:08

floodfish
Member
From: Brooklyn, NY
Registered: 2007-01-11
Posts: 155
Website

Re: bot_write_tab_customize: rearrange and style items in the write tab

Anybody have some advice or feed back about my hiding (by) sections issues described above?

Do these work for you? Am I misunderstanding what should happen?

Offline

#84 2010-02-17 19:56:24

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: bot_write_tab_customize: rearrange and style items in the write tab

floodfish wrote:

Anybody have some advice or feed back about my hiding (by) sections issues described above?
Do these work for you? Am I misunderstanding what should happen?

Oops!
Sorry Jason, I completely missed this post!
Anyway, from reading your first post I get that the plugin is not working at all for you :-(

This should make a given field disappear when editing an article in a checked section, correct?

Yes. In other words – when you are editing or creating an article – visible fields should change based on the section you choose from the sections dropdown.

I can’t seem to get it to do that, or indeed anything else.

so nothing hides, nothing moves, js (inserted in the js box) is not applied?
I guess the plugin is not working…

Now let’s see what can be the problem..

First: can you see the jquery code generated by the plugin in the “write” tab source code ?

Offline

Board footer

Powered by FluxBB