The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

EM Beer Manager
[resolved] Adding brewery field to sidebar widget (3 posts)

  1. hellobenno
    Posted 2 years ago #

    Hi there,

    Firstly thanks for making a simple to use beer database plug in.

    I am trying to hack it about a bit to get it to display things slightly differently in the sidebar.
    Can I isolate the fields to apply different css styling to them.
    I have altered the widget title, but I can't work out how to alter the styling on the beer name and info separately.

    Also I would love to be able to include the name of the brewery/creator in the sidebar as well. I am aware that that would involve creating an extra field within the php and a load of hooks etc which is above my level of coding.

    Any updates in the pipeline for this plugin with extra or even custom fields that can be added?



  2. Erin Morelli
    Plugin Author

    Posted 2 years ago #

    Hi Ben,

    So the *original* intention of this plugin had been for people/breweries to display and organize beers that they themselves had created, which is why "brewery" is not currently an option. I added the "groups" functionality to circumvent that a bit, since people seem to be using it for other things.

    Because of that, I don't have any intention of ever adding a "brewery" option. However I am planning an updated release of the plugin, eventually, which will offer custom fields options. It will allow for more information to be stored about a beer (like OG, FG, SRM) or for customized data. So in your case, you could use this to add "brewery" if you wished.

    Since I do work full time and this is a side project, I can't give an exact estimate on when this update will be out, but it will *hopefully* be within the next few months.

    In the meantime - for your styling/display issues:

    The beer's widget title should be targetable via CSS with li.embm-beer-list-item a and the information below should be targetable with li.embm-beer-list-item .embm-beer-summary. If those aren't working, you may want to throw some !important tags onto the style overrides you're trying to make.

    As a temporary hack for displaying the brewery - my recommendation would be to make each brewery/creator a group, then tag the beers appropriately. Then you can make a quick edit to the widget PHP file in plugins/em-beer-manager/includes/components/widget-beer-list.php. If you go to line 204 in the file, add 2 new lines and copy/paste this code:

    $group = wp_get_object_terms($post->ID, 'embm_group');
    $output .= '<span class="embm-beer-group">'.$group[0]->name.'</span>'."\n";

    That will add the beer's group name just below the beer's name - then you can style it with the .embm-beer-group class.

    I hope that's helpful and I'm glad you like the plugin!

  3. hellobenno
    Posted 2 years ago #

    That looks like a good work around. I was trying to do something like that.

    I was already tagging the beers by brewery using the group function. I was also planning on tagging some of them as 'New' to use the sidebar widget to display just the latest beers, so then it would also display New of course...

    I do understand I am not using this plug in for its original purpose, as a homebrewer myself I can see its merits for cataloging and displaying creations.

    It would appear however there is basically nothing designed specifically for the purpose of creating and curating a beer database on wordpress. I am sure a custom field plug in could be used to start from scratch but my .php is ropey to say the least!

    I have managed to style the widget using css !important overrides in my theme indeed..

    Orignial Gravity etc would be a great addition for brewers and home brewers alike of course.

    I'll give you suggested hack a go.
    Thanks for the response

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • EM Beer Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.