Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#49 2010-01-26 10:57:15

dl33
Member
Registered: 2006-06-17
Posts: 192
Website

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

redbot wrote:

… I won’t add the category box from rss_unlimited_categories though because is a plugin-specific item. The good news is if you tell me the id of this item (or paste here the relevant html code) I’ll show you how to modify bot_wtc to make it work. (only a one-line mod is required)

Great, thanks for the help. The actual select has an id of rss_uc_multiselect_id, although there are items in div above its level. This is the same for most other items though…

Offline

#50 2010-01-26 11:11:00

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

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

dl33 wrote:

… . The actual select has an id of rss_uc_multiselect_id, although there are items in div above its level. This is the same for most other items though…

Could you please post here the html code of the select item and the surrounding elements?
I’m asking because I never used this plugin and it’s important to target the correct jquery selector in order to avoid to leave orphaned elements around

Last edited by redbot (2010-01-29 19:59:36)

Offline

#51 2010-01-26 11:32:30

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

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

speeke wrote:

…There is also another problem in that I cannot clear the last one at all (ie one section always appears selected). The only way I can clear it is to edit bot_wtc_static_sections in txp_prefs in the DB.

Sorry Sarah I missed your post above. Anyways yes, this is a bug which is already fixed in my development copy and will be corrected in the upcoming version which will be released in a few days.
Regarding the other issues you mention I’ll have a look in the next days.

all of my sections hide when selected in your plugin except one (the “about” section). For some strange reason it is still visible, even though I’ve selected it to hide

Are you sure it is not set to be the “default” sections in your “sections” tab?

Offline

#52 2010-01-26 11:56:17

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

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

speeke wrote:

Well it is the first section in the dropdown, if that’s what you mean? Not sure how to define a default for the sections tab. I couldn’t see any reference to it in the preferences.

In the “sections” tab, under presentation, there are some options for each section.
One of these is “selected by defaut”.
If your “about” section is ‘selected by default’ it cannot be hidden (by purpose).
I hope it’s more clear now.

Last edited by redbot (2010-01-27 23:24:13)

Offline

#53 2010-01-26 12:13:22

dl33
Member
Registered: 2006-06-17
Posts: 192
Website

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

redbot wrote:

Could you please post here the html code of the select item and the surrounding elements?
I’m asking because I never used this plugin and it’s important to target the correct jquery selector in order to avoid to leave orphaned elements around

<div>
	<p>Kategorisieren [<a href="?event=category">Bearbeiten</a>]<br>
		<select id="rss_uc_multiselect_id" name="Cats[]" class="list" size="10" multiple>
			<option value="22">10% Empfehlungsnetz</option>
			<option value="20">Allgemeines</option>
			<option value="24">Faszination Physik</option>
			<option value="19">Immobilien Filme</option>
		</select>
	</p>
	<p>[<a href="javascript:document.getElementById('rss_uc_multiselect_id').selectedIndex=-1;noop();">Deselect all</a>]</p>
</div>

Offline

#54 2010-01-26 12:31:26

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

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

dl33

Ok, thank you.
Now let’s try to add this item in the plugins code.
Go to plugins>bot_write_tab_customize and click modify.
Around line 55 (at the end of the list) add this line:

bot_wtc_insert_in_main_array ('rss_unlimited_categories', '$("div:has(select[id=rss_uc_multiselect_id])")');

Save and see if it works. If it doesn’t, report here and I’ll check if I made some errors.

Offline

#55 2010-01-26 12:37:21

dl33
Member
Registered: 2006-06-17
Posts: 192
Website

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

redbot wrote:

bot_wtc_insert_in_main_array ('rss_unlimited_categories', '$("div:has(select[id=rss_uc_multiselect_id])")');

Great, works perfectly…

Offline

#56 2010-01-27 00:03:06

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

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

speeke wrote:

When I made a section other than “about” “selected by default” the “about” section would hide in bot_wtc as expected. However, when no sections are “selected by default”, the “about” section does not hide, even thought I ask the plugin to do so. So, there still seems to be a problem with the first section in my list. Bizarre!

There is a reason for this.
Let me explain: suppose you have a section “about” which contains only one article (and often it is the case). You’ll want to hide it from the sections dropdown because you know your client shouldn’t be allowed to put another article in it.
BUT
suppose your client wants to edit the only existing article in section “about”: he’ll have to go to the “articles” tab and select it.
In this case – and only in this case – it makes sense that the section “about” shows in the dropdown for at least two reasons:

  1. one concerns usability – it makes sense for me that he can see the section to which the article he is editing belongs.
  2. the other is a “technical” one. When saving an article a section is required by txp – if there is no selected section the article won’t be saved and txp will throw an error.

To make it short I decided on purpose that a section should be removed from the dropdown always except when it is selected on page load (in other words when you are editing an already existing article).

In your case, given that you haven’t chosen a section to be “selected by default”, the first one in alphabetical order (about) is selected and this triggers the behaviour I explained earlier.
At the end I don’t think it is a problem at all as you should always choose a section to be “selected by default” to ease your workflow (every site has a section which is used more often than others and it helps to have it already selected)
I hope I have shed some light on the matter even if my english sucks.

Also, I was wondering if it would be possible to output the section list in bot_wtc so that the sections appear in name order? It would just make it a little easier to search the list.

Yes of course, I’ll add it to the next release.

Last edited by redbot (2010-01-27 00:11:06)

Offline

#57 2010-01-27 21:54:41

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

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

Great plugin redbot – I somehow missed this one and have just used it for the first time… blown away, just what I was after.

Thanks

Offline

#58 2010-01-28 10:51:36

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

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

This is really cool redbot. I don’t know if this is already possible: The option to register an expand/collapse label that would toggle a grouping. The grouping would also have to be registered. Like: Toggle1 (custom_1, custom_23, article_image, etc).

Eh?

Gerhard looks as though he’ll implement this sort of functionality in glz_custom_fields and because I am using that and your plugin extensively right now it occurred that the two should continue to jive together and do great things together.


txtstrap (Textpattern + Twitter Bootstrap + etc…)

Offline

#59 2010-01-28 12:16:47

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

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

whaleen wrote:

… The option to register an expand/collapse label that would toggle a grouping….

Hi Josh,
this feature is not provided by default but 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.

Last edited by redbot (2010-01-28 12:17:01)

Offline

#60 2010-01-29 01:20:53

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

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

redbot wrote:

For the collapsible excerpt write this rules in the js box, after you have attached a “collapse” class to the excerpt:

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

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

Last edited by mlarino (2010-01-29 01:35:35)

Offline

Board footer

Powered by FluxBB