Jump to content

Batcher MOD *** Edit tags


MuchDev
 Share

Recommended Posts

Hey there everybody, yet another general question in the attempt to clarify some of my understanding. I have a great tag system up and running and would like to provide the client a quick way to tag multiple items within the site. There are situations as such:

A batch of work is going to be displayed in a section that pulls via a selected tag. These works will be selected individually and may be based on all sorts of criteria things like price, or medium, or artist country of origin. For this what I invision is the ability to create a selector in batcher and update all of these items with a specific tag. Is this funcitonality something that already exists in a module?

I know I can currently build these queries in batcher, but unfortunately there is no way to add fields to the editior to be able to batch update many items. 

Link to comment
Share on other sites

I don't think there is a currently a module that does this but you can easily build a simple Process Module to do this. It can either be based on Batcher (i..e. copy its code, rename it and customise to your needs) or see how similar things are done in Blog (see the posts dashboard - both quick post and bulk actions). Start building something and the forum will be here to help you :-) Btw, are you tagging with existing tags or creating tags on the fly or both?

  • Like 1
Link to comment
Share on other sites

OK, I have gone ahead and customised Batcher to do this. Almost ready but there are a few kinks (js/css). The 'Tag' action is hidden on load (similar to Change Parent) but it is not hidden on selection of a different option; js is not my forte.

PW API side works fine although you may want to limit the number of pages you apply batch tags to. You can apply single or multiple tags. There are also some hard-coded things in there that you might want to change such as the name of your 'tags' field. Just search for @@kongondo in the ProcessBatcherExt.module and ProcessBatcherExt.css files for changes I added. Feel free to do with it as you please :D

BatcherExt.zip

  • Like 9
Link to comment
Share on other sites

Thank you so much for this kongondo! The work you did in there is fantastic. Well I'm not much of a javascripter but I may be able to tweak the code a bit. I'll need to read through everything to make sure, but this is going to totally save my baccon. YOU ARE MY HERO. I'll try and post back anything I come up with.

***

People such as yourself are what make processwire amazing! 

  • Like 4
Link to comment
Share on other sites

Ok, this is amazing! I have just tagged around 400 items with various keywords, I can now build all sorts of sections in moments without disrupting the perfect heirarchy of the pages themself. To be honest I cant find anything wrong with how the javascript works, it looks great. It doesn't seem to allow the adding of a tag that doesn't already exist, but that isn't a big deal.

Kongondo, I want to buy you a beer buddy. 

Link to comment
Share on other sites

Glad you got it sorted.. :-)

 
For the curious, the reason why the option 'tag' is not being hidden on selection of another select input is because the following doesn't work with pageautocomplete:

$tags->attr('class', 'batcherAction'); 

I guess the reason is that it is a different kind of inputfield. Don't know how to get around this. Because of the above, the following js doesn't catch:

$('#batcherAction').change(function(){
	var option = $(this).find('option:selected').val();
	$('.Inputfield_tags').closest('li.Inputfield').hide();
	$('#wrap_'+option).show().css('list-style-type', 'none');
});

Of course there are other ways to get around this using js...

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...