Posted: October 14, 2011 in Web

Download My Company Menu plugin for WordPress

This plugin is being submitted to the WordPress repository. For now, you can download it here: mycomp-menu-v1.0.zip
The plugin is now available in the WordPress repository: http://wordpress.org/extend/plugins/my-company-menu/


Background and goals of this plugin

This plugin is intended for theme developers who build WordPress websites for other businesses. WordPress has become my CMS of choice for so many reasons, and I find myself exploring ways to give my clients a better experience. The MCM plugin, overall, helps my clients manage their content a little bit easier.


Create a custom company menu in WordPress

My Company Menu tab in admin panel

For starters, MCM adds a new tab in the Admin’s Sidebar, which links to a page to manage standard business contact information and social networking links.

Add your own custom subpages

I also use this new menu to organize Pods, like a Work Portfolio or Team Member Manager. This lets me create custom managers for my client and consolidate them under one menu, keeping the sidebar simple and clean.

Demo page mcm_menu.php

I include a Demo Page (mcm_menu.php located in the plugin directory). If you have no need for additional subpages, just check the Hide Demo Page box on the Help/Settings page to remove it. Otherwise, move mcm_menu.php from Plugins to your Uploads directory to customize it as needed (this will ensure your tweaks remain after an update).

The file mcm_menu.php has ample template functions and recommendations for creating your own custom pages.


My Company Menu help/settings page

Customize menu title and icon

Change the menu’s title and icon to match your client’s branding on the Help/Settings Page.


My Company Menu contact information

Manage company contact information

Give your clients an interface to manage typical contact information, such as:

  • Phone number
  • Toll free number
  • Fax number
  • Email address
  • Disclaimer
  • Physical address

Manage links to your social media sites

Manage social media links

With MCM, just echo the company_social() function in your template file to display icons for fields with a URL. Now, your client can add URLs and the appropriate icons will display automatically.

Supports Google+, Facebook, Twitter, LinkedIn, YouTube, and Vimeo—standard business-related networks.

Icons load as an unordered list with a class of mcm_social. Soon, you will be able to specify your own images.


Customize social media icons with sprite image

Customize social media icons

New in 1.0.5 Now you can customize the upstate and hover state of your social media icons by using an image sprite.

Just upload your sprite image, specify the width and height of individual icons, and give the background position coordinates for each.


Shortcodes and Functions

Each field has a shortcode beneath it that can be used on posts and pages to show the contents of the related input box. Theme developers can use the same shortcode as PHP functions in templates to display the data.

You should verify if each field has a value, then echo something based on success/failure. Each shortcode shares the name of the function for your template pages.

For example, the shortcode for the Company Phone Number is [ company_phone ]. So, incorporate this into your template with:

<?php
  if(company_phone()) { // check if has value
    echo company_phone(); // if yes, display value
  } // if not, nothing is displayed
?>

 

<?php
  if(company_phone()) { // check if has value
    echo company_phone(); // if yes, display value
  } else {
    echo 'No phone number entered'; // if not, display message
  }
?>

The following shortcodes are available at this time.

  • Phone Number: [ company_phone ]
  • Toll Free Number: [ company_tollfree ]
  • Fax Number: [ company_fax ]
  • Email Address: [ company_email ]
  • Disclaimer: [ company_disclaimer ]
  • Address (multi-line): [ company_address ]
  • Address (one line): [ company_address_oneline ]
  • Google Plus: [ company_gplus ]
  • Facebook: [ company_facebook ]
  • LinkedIn: [ company_linkedin ]
  • Twitter: [ company_twitter ]
  • YouTube: [ company_youtube ]
  • Vimeo: [ company_vimeo ]
  • RSS Feed: [ company_rss ]
  • List social icons: [ company_social ]

TinyMCE integration

Easily add the company’s phone number or email address into a post by clicking the new buttons in your WYSIWYG editor.
TinyMCE integration


Future goals of this plugin

  • Custom social media icons
  • Interface for adding Pods as subpages (currently a manual process in mcm_menu.php)
  • Google Maps integration

I graduated from LSU with a B.F.A. in Graphic Design and a minor in Art History. My passions are web design and front-end development with over 10 years of experience.


2 Trackbacks/Pingbacks
  1. Pingback: My Company Menu plugin for WordPress on February 1, 2012
  2. Pingback: My Company Menu | Best Plugins - wordpress – widgets – plugin on March 30, 2012
9 Responses to My Company Menu plugin for WordPress
  1. luchosar

    Warning: include(../wp-content/plugins/mycomp-menu/mcm_menu.php) [function.include]: failed to open stream: No such file or directory in /home/luchosar/public_html/wp4/wp-content/plugins/my-company-menu/mycomp_menu.php on line 136

  2. Jason Cross

    Thanks for the bug; the repository used a different directory name than I had intended. The fix has been committed (v1.0.2), and you should see it soon.

  3. Chip

    Has there been any further development on getting Google Maps integrated? Or the ability to create additional fields for the company?

    Thanks!

  4. Brent Wallace

    Hi Jason,
    I just downloaded your plugin to try. Looks very promising!
    I need to add custom field like..
    Slogan 1
    Slogan 2 , etc.
    Where do I add that to the php code?
    Thank you,have a great day also!
    Brent

  5. Jason Cross

    @Chip – Unfortunately, personal projects get backburnered in favor of client work. I use this plugin on nearly every WordPress we do, so it’s on my list!

  6. Jason Cross

    @Brent,

    Sorry for the delay. Do this:

    In mycomp_menu.php:

    • Add an option to the set_mycomp_menu_activate function (your slogan, in this case)
    • Add it to the get_mycomp_menu_contact function

    In mycomp_menu_markup.php:

    • Add your new item to a new tr element, following the convention throughout this page. This will show the item on the form in the admin area.

    In mycomp_menu_form_process:

    • Add your item to update_mycomp_menu function
    • Add your item to unset_mycomp_menu_deactivate function

    And that should cover it. You’ll want to deactivate/reactivate the plugin again to see your changes. Hope this helps!

  7. Andrew Croce

    Hello, great plugin. I am wondering if there are shortcodes or template functions to retrieve the individual physical address fields, rather than all of them at once.

    Also, I wanted to just point out that the company address shortcode/template functions output the content within an HTML tag. I’m sure its debatable, but this is not really the correct usage of that tag. The current spec says this tag should only contain a physical address if it is part of the contact information of the document/article owner. So this may be the case in some instances, but the physical address should not be itself isolated in an tag.

    Thanks

Leave a comment

Did this article help you? Do you have a different opinion? Feel free to leave a comment or ask questions.