Jump to content
MuchDev

Batcher MOD *** Edit tags

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. 

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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. 

Share this post


Link to post
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

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Marcel
      Hey,
      I am about to use the tool Create Users Batcher. We have 450 users. When I tryed it with like 20 test users it worked but it took a while. Now my concerns are that 450 might be to stressful? Does anyone have experience with several hundreds of users? My thoughts are to split it in smaller goups and upload them one group after another.
      best wishes
      marcel
    • By celfred
      Hello,
      I'm struggling with this : a 'group' field of 'Page' type.
      The parent of selectable pages is '/groups', the template is 'group', and a member can create some groups in the /groups tree. I would like this user to see only the groups he or she has created so in my 'Find selector' in the backend, I would like to use :

      template=group, created_users_id=$user->id But that doesn't seem to work... I still get the list of all available groups in the /groups tree.
      Any idea ?
      I had a feeling I had already seen that before (something like $user->id must be replaced by users_id or something, but I can't find anything in the Forums... and all my tests keep failing...
    • By Sanyaissues
      After enable the Tags File Compiler module, echoing variables with brackets syntax doesn't work. I try something simple like {page.title} and is displayed like the tag isn't parsed:
      {page.title} This problem happens with PW 3.0.108, i have another installation with 3.0.82 and it works. Any Ideas? thanks.
    • By sww
      Hey there,
      is there really no way to turn the OR logic into an AND logic when selecting pages by (e.g.) tags?
      so instead of
       $pages->find("template=exhibitions, tags=foo|bar") something like
       $pages->find("template=exhibitions, tags=foo&&bar") so the pages needs to have all requested tags, not just any of them.
       
      Thanks,
      Stefan
    • By louisstephens
      So, I really don't know where to begin with this. I have the thought in my head (the basics), but not really sure how to set it up.
      The desired effect:
      The homepage is set up with a foreach loop that outputs all the child pages (basically just a bunch of pages with pdfs, docs etc stored in a file field). When A user is actually logged in, they can "star" an item or drag and drop (using Dragula) the page to a sidebar. Also, they would be able to reorder the pages in the sidebar.
      The question(s):
      I guess I have multiple questions regarding how to achieve this.
      Would it be best to create a page field in the user template to save the page(s)? How would you actually save the page state (sidebar output, reordering, etc) once the drag and drop has been used? Thanks in advance for any help! A lot of this was just what was in my head, so it might not make full sense. However, I will update this if I can actually wrap my head around everything.
×
×
  • Create New...