Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2018-05-16 09:42:52

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 3,061
Website

Re: bot_wtc v8 for Textpattern v4.7 (beta)

0.7.5 is the old version for 4.6.2. I’ll have to try that on a fresh installation of the newest 4.7 final but I wasn’t aware of that.


TXP Builders – finely-crafted code, design and txp

Offline

#12 2018-06-03 17:35:06

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 617
Website

Re: bot_wtc v8 for Textpattern v4.7 (beta)

On 4.7 with bot_wtc v8 i get an error after disabling and reenabling the plugin:

Notice "Undefined index: $(".custom-")" in /home/kliklak/public_html/infra/textpattern/lib/txplib_misc.php(1826) : eval()'d code at line 459.

and

textpattern/lib/txplib_misc.php(1826) : eval()'d code:459 adminErrorHandler() textpattern/lib/txplib_misc.php(1826) : eval()'d code:524 bot_contextual_selectinput() textpattern/lib/txplib_misc.php(1826) : eval()'d code:872 bot_wtc_output_rows() textpattern/lib/txplib_misc.php:1945 bot_wtc_tab() textpattern/index.php:257 callback_event()

preexisting settings for my write tabs are only half existing and appear somehow garbled.

EDIT: Tried several times now, the error reappears after disabling/reenabling plugin.

Last edited by jayrope (2018-06-03 18:21:44)


a hole turned upside down is a dome, though only when there’s gravity.

Offline

#13 2018-08-22 18:05:35

jpdupont
Member
From: Virton (BE)
Registered: 2004-10-01
Posts: 746
Website

Re: bot_wtc v8 for Textpattern v4.7 (beta)

Hello Jakob,
see :

here, in the multiple select tool, the section dropdown show the sections hidden in the bot_wtc window.

Is it possible to hide the same sections as in the write screen, and display here the titles and not the names ? And sort the titles !

Thanks !

Offline

#14 2018-08-22 19:56:23

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 3,061
Website

Re: bot_wtc v8 for Textpattern v4.7 (beta)

jpdupont wrote #313580:

Here, in the multiple select tool, the section dropdown show the sections hidden in the bot_wtc window. Is it possible to hide the same sections as in the write screen, and display here the titles and not the names ? And sort the titles !

That’s in the article list pane, right? I don’t think so, I’m afraid. The multi_edit form doesn’t have a pluggable_ui hook so there’s not an in-built mechanism for modifying it with a plugin. Also bot_wtc only loads in the Write pane so the user javascript wouldn’t act on the list pane.

As far as I can tell, the section dropdown is constructed here using this function which requires key => value array pairs (see notes above the function) to construct the dropdown with labels. Currently that’s populated by $all_sections which is a single list array of just the section names.

Two possible options:

One way I can think of to achieve everything you want – though the devs may have a better suggestion – is to make a minor amendment (patch) to the code of /include/txp_list.php. As $all_sections is needed later to match against the chosen values, I wouldn’t change that. Instead, something like this:

  • Retrieve the section titles into a second array, e.g. $all_section_titles, using the same sort order as $all_sections, then array_combine the two into a new name => Label array (or start over and create a fresh array out of the ‘name’ and ‘title’ of txp_section).
  • Look up the hidden sections in the table txp_prefs called bot_wtc_static_sections and unset those sections from the array.
  • Sort the array by the title.
  • Replace the inputSelect line using your own new array.

The remainder should still function, all you’ve changed is the construction of the dropdown.

Another option would be to remove the sections you wish to hide using jquery/javascript. Add a file called custom.js to /admin-themes/{hive or your-theme}/assets/js/ (see the admin-theme readme) and remove the options you don’t want to have from the dropdown that way. If you make a lookup table of section names and section titles, you could potentially also modify the dropdown labels with jquery and then sort all the options. It’s not very dynamic but if your site doesn’t change much, perhaps that’s an option. You might be able to use the same code to modify the dropdown in adi_matrix, too.


TXP Builders – finely-crafted code, design and txp

Offline

#15 2018-08-22 20:54:41

jpdupont
Member
From: Virton (BE)
Registered: 2004-10-01
Posts: 746
Website

Re: bot_wtc v8 for Textpattern v4.7 (beta)

Thanks Jakob for this long analysis …
Previously, the dropdown of the sections in the write page was based on the names and not on the titles, and today, this list is sorted on the titles. Can not we use this code? Gocom had created rah_sections_titles to work around the old display …
Hiding sections as in bot_wtc is not as important as posting titles rather than names, for our clients.

Offline

#16 2018-08-22 21:22:40

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 3,061
Website

Re: bot_wtc v8 for Textpattern v4.7 (beta)

On the write tab, there is a pluggable_ui hook for replacing the entire section dropdown. I think that’s what Gocom used (also for his status radio buttons plugin). But you’re talking about the article list page, or am I mistaken?

It’s possible that some of the code for the section dropdown on the write tab could be relevant for the multi-edit chooser, but the ui element for the multi_edit chooser is more complex as it covers lots of situations in one combo box.

The “analysis” was to give you some pointers if you want to attempt it yourself :-)


TXP Builders – finely-crafted code, design and txp

Offline

#17 2018-08-23 06:03:04

jpdupont
Member
From: Virton (BE)
Registered: 2004-10-01
Posts: 746
Website

Re: bot_wtc v8 for Textpattern v4.7 (beta)

Thank you Jakob,
I will see what I can do myself in this particular case :-)

However, I want to reveal this inconsistency, when we compare the two drop down here: the categories listed and sorted by title, and the sections listed by name, and not sorted … What disturb the user.

Offline

#18 2018-08-23 07:44:22

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 3,061
Website

Re: bot_wtc v8 for Textpattern v4.7 (beta)

jpdupont wrote #313586:

However, I want to reveal this inconsistency, when we compare the two drop down here: the categories listed and sorted by title, and the sections listed by name, and not sorted … What disturb the user.

You’re right, it should really be the section titles in alphabetical order. The same goes for the authors too. As far as I can tell, categories and statuses (stati?) are already okay.

I’ve added an issue to GitHub for that.

Then you’d only need to do the removing items from the list with js.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB