• Resolved MediaWithMagic

    (@mediawithmagic)


    Nate,

    First off, I am loving this plugin. I have found so much in it that has surprised me and offered extra fidelity that it’s just highly impressive. Looking forward to exploiting its abilities even more.

    I’ve searched for this topic in the forums here but can’t find it, so here goes.

    I’m trying to rearrange the menu item image location from the left of the title and content to prior to the title and price and content displaying.

    I don’t like the way it looks with a few items having images and others not, since it starts breaking up the vertical lines in the page, but if I can move that image over top of the menu item, and perhaps set a bit of an extra margin above it, I can start highlighting certain items and get a much better menu appearance.

    I’ve looked over custom themes, and can see the menu-item.php setup where the layout is produced by: echo $this->print_elements( 'body' );.

    And I’ve found the content.php, image.php, and so forth in the /content/ folder, but I’m having a problem finding out where I can edit the print_elements( 'body' ); function so I can rearrange which element is chosen first.

    Any help you could provide would be great.

    Thanks in advance, and thanks again for a great plugin!
    Dan

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @mediawithmagic,

    The fdm_menu_item_elements_order filter allows you to adjust the order of elements:

    https://github.com/NateWr/food-and-drink-menu/blob/master/views/View.Item.class.php#L71

    You can use the fdm_menu_item_elements filter to move an element from one position (eg – body) to another:

    https://github.com/NateWr/food-and-drink-menu/blob/master/views/View.Item.class.php#L70

    This is a bit cumbersome, but it allows me to inject components into the output without overriding the templates (for example, with my Pro addon). In hindsight, I probably would have preferred a simpler technique, but anyway you can get where you’re going either way.

    You might not actually need this, though. You can probably accomplish what you want with just some CSS code:

    
    .fdm-item .fdm-item-image {
        float: none;
        margin: 1em 0 0;
    }
    .fdm-item.fdm-item-has-image .fdm-item-panel p {
        padding-left: 0;
    }
    
    Thread Starter MediaWithMagic

    (@mediawithmagic)

    Nate,

    First off, thanks so much for the quick response. Help within 24 hours, and it was exactly what I needed!

    As it turned out, the CSS you supplied worked perfectly without having to modify anything else, and as that goes in the Custom CSS area, makes it even better for updates and such.

    I’ll keep the other solutions in mind though, those might come in handy in the future.

    My menus look awesome now, sir! Thanks again for all your hard work on this. I’m thinking that I can open up a whole new sales niche for restaurants with this bad boy.

    Have a great weekend!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Rearranging Menu Item Image Location’ is closed to new replies.