Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-01-05 16:51:27

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

A filter categories plugin for back office ?

Hi folks.

First: I wish you an happy new year!

Second: Is there a plugin to display only parent categories into the “Cat1” list and only child categories into the “Cat2” list from the Textpattern back office?

I never seen before and I need it :)

Cheers,


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#2 2013-01-05 17:34:26

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

Re: A filter categories plugin for back office ?

Hi Patrick and happy 2013 to you too. As far as can remember there is no such plugin.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2013-01-05 20:46:05

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: A filter categories plugin for back office ?

Hi Yiannis.

Thanks for your reply. That’s what it seemed to me.


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#4 2013-01-06 11:24:21

MarcoK
Plugin Author
From: Como
Registered: 2006-10-17
Posts: 248
Website

Re: A filter categories plugin for back office ?

Hi Pat.

I have write this plugin, but I don’t know if is what you need. It’s in beta version…

mck_article_subcategory

Let me a report if it work! I must release it….

Offline

#5 2013-01-07 08:54:28

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: A filter categories plugin for back office ?

Hi Marco :)

Great: It seems you’re working on this! That’s an amazing new and a really useful idea in order to give final users a logical and consistent UI. But unfortunately, I can’t make it working :(

jQuery array is present into the page document with all parent categories in it but mothing appends into the select choices on the change action.

I can’t waiting to use your final version, man!

Edit: Marco, it seems that var parent-cats = {"parent-cat-1":"Parent cat 1","parent-cat-2":"Parent cat 2","parent-cat-3":"Parent cat 3","parent-cat-4":"Parent cat 4"}; doesn’t work ( alert(parent-cats) return nothing).
Instead var parent_cats = {"parent-cat-1":"Parent cat 1","parent-cat-2":"Parent cat 2","parent-cat-3":"Parent cat 3","parent-cat-4":"Parent cat 4"}; works ( alert(parent_cats) return object Object).

Last edited by Pat64 (2013-01-07 09:39:22)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#6 2013-01-07 17:12:03

MarcoK
Plugin Author
From: Como
Registered: 2006-10-17
Posts: 248
Website

Re: A filter categories plugin for back office ?

Offline

#7 2013-01-07 18:38:37

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: A filter categories plugin for back office ?

Hé, hé. Marco ! I think you’re very close, man!

Just a few things :

  • IMHO, all your category-2 classes need to be changed into divs one (#category-2) according to the Textpattern source code (TXP 4.5.4 version and above).
  • I have a parent category named “Comso’Actions” (note the quote here). So the code doesn’t works until I change it to “Consom-Actions”:
var accueil_sur_terre={"campagnes_en_cours":"Campagnes en cours","la_photo_du_mois":"La Photo du mois","les_rendez_vous":"Les Rendez-vous","presentation":"Présentation"};
var actu_planete={"agriculture_alimentation":"Agriculture et Alimentation","air_eau":"Air et Eau","biodiversite":"Biodiversité","chasse_peche":"Chasse et pêche","energies":"Energies","habitat_different":"Habitat différent","sante_hygiene":"Santé et Hygiène","transports":"Transports"};
var consom_action={"analyse_systemique":"Analyse systémique","consom_boycot":"Consom'boycot","consom_symbiose":"Consom'symbiose","testing_produit":"Testing produit"};
var rencontres_en_symbiose={"l_invite_de_la_planete":"L'invité de la planète","rencontre_experience":"Rencontre et expérience","rencontres_ailleurs":"Rencontres d'ailleurs"};
$(document).ready(function() {
  $("#category-1").html('<option></option><option value="accueil_sur_terre">Accueil sur Terre</option><option value="actu_planete">Actu-Planète</option><option value="consom_action">Consom-Action</option><option value="rencontres_en_symbiose">Rencontres en symbiose</option>').live('change',function(){
    cat2change($(this).val());
  });
  $('#category-2').hide();
  function cat2change(val){
    if(val=="" || typeof window[val]=="undefined"){
     $('#category-2').hide();
     return;
    }
    $('#category-2').show();
    $('#category-2').html('');
    $.each(eval(val), function(key, text) {
      $('#category-2').append( $('<option></option>').val(key).html(text) )
    }); // there was also a ) missing here: Not at all Marco, it works!
  }
});

So is there a solution to escape such as quote signs into the parent category names?
If yes, I think you can publish your amazing plugin, man!

Great job. Thank lot for this (very usefull and very interesting plugin).

Cheers,

Last edited by Pat64 (2013-01-07 18:40:19)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#8 2013-02-10 09:59:21

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: A filter categories plugin for back office ?

Hi Marco.

I identify a problem with val into the jQuery script:

$.each(eval(val), function(key, text) {
    	// Here: val keys need to be converted with hyphen in order to reflect the category names
      $('#category-2').append( $('<option></option>').val(key).html(text) )
    });

Here is the problem: if I’ve got more than one word into cat1, the plugin doesn’t worK. If I’ve got only one word into cat1, the plugin works.

Cheers,

Last edited by Pat64 (2013-02-10 15:23:51)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#9 2013-06-26 16:38:24

hariseldon
New Member
Registered: 2013-06-26
Posts: 1

Re: A filter categories plugin for back office ?

MarcoK wrote:

Hi Pat.

I have write this plugin, but I don’t know if is what you need. It’s in beta version…

mck_article_subcategory

Let me a report if it work! I must release it….

That looks great!!!

_____________________________________________________________
Free hosting

Last edited by hariseldon (2013-09-16 06:51:28)

Offline

#10 2013-06-26 17:27:22

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: A filter categories plugin for back office ?

Ah, thanks for reminding me of this plugin, hariseldon!


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

Board footer

Powered by FluxBB