Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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
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
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
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…
Let me a report if it work! I must release it….
Offline
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
Re: A filter categories plugin for back office ?
Thanks Pat.
Offline
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
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…
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,306
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