doc4design.com - Tutorial: Condensing the Flutter menu
10. July 2009 · Author: Dale Crum
8 Comments

Tutorial: Condensing the Flutter menu

One of the few flaws we’ve found with Freshout’s WordPress plugin entitled Flutter is the manner in which it displays Custom Write Panels. Flutter lists the Write Panels in the WordPress navigation under no distinct heading. WordPress breaks the navigation down in an orderly fashion for us: Dashboard, Posts, Media, Links, etc. only to be interrupted by what typically turns into five to eight Custom Write Panels making a mess of the usability. The problem becomes truly evident when combining it with Ozh’s Drop Down Menu plugin where the added horizontal menu can quickly be overwhelmed by multiple Custom Write Panels pushing the Ozh menu down into two lines.

What we propose is more effective method of organization. By removing the Custom Write Panels from the main navigation and placing them under their respective headers of Posts and Pages we not only save space but give the Custom Wrte Panels a more logical, user-friendly placement. In order to accomplish this we need to make an alteration to the RCCWP_Menu.php file.

Remove the following from RCCWP_Menu.php lines 432 to 456 ( Flutter version 1.1 )

if ($panel->type == "post"){
 if($panel->single == 1){  //if the post is single
 if($add_post){ //if the post is single and don't have any related post
 add_submenu_page($base+$offset.'.php', __($panel->name), $new_indicator_text, $requiredPostsCap, 'post-new.php?custom-write-panel-id=' . $panel->id);
 }else{ //if have one related post we just can  edit the post
 add_submenu_page($base+$offset.'.php',__($panel->name),"Edit", $requiredPostsCap,'post.php?action=edit&post='.$has_posts);
 }   
 }else{
 add_submenu_page($base+$offset.'.php', __($panel->name), $new_indicator_text, $requiredPostsCap, 'post-new.php?custom-write-panel-id=' . $panel->id);
 add_submenu_page($base+$offset.'.php', __($panel->name), $edit_indicator_text, $requiredPostsCap, 'edit.php?filter-posts=1&custom-write-panel-id=' . $panel->id);
 }
 }else{
 if($panel->single == 1){ //if the page is single
 if($add_post){ //if the page is single and don't have any related post
 add_submenu_page($base+$offset.'.php', __($panel->name), $new_indicator_text, $requiredPagesCap, 'page-new.php?custom-write-panel-id=' . $panel->id);
 }else{
 add_submenu_page($base+$offset.'.php',__($panel->name),"Edit", $requiredPagesCap,'page.php?action=edit&post='.$has_posts);
 }
 }else{
 add_submenu_page($base+$offset.'.php', __($panel->name), $new_indicator_text, $requiredPagesCap, 'page-new.php?custom-write-panel-id=' . $panel->id);
 add_submenu_page($base+$offset.'.php', __($panel->name), $edit_indicator_text, $requiredPagesCap, 'edit-pages.php?filter-posts=1&custom-write-panel-id=' . $panel->id);
 }
 }
 }

And replace it with the following:

if ($panel->type == "post"){
 if($panel->single == 1){  //if the post is single
 if($add_post){ //if the post is single and don't have any related post
 add_submenu_page('post-new.php', __($panel->name), __($panel->name), $requiredPostsCap, 'post-new.php?custom-write-panel-id=' . $panel->id);
 }   
 }else{
 add_submenu_page('post-new.php', __($panel->name), __($panel->name), $requiredPostsCap, 'post-new.php?custom-write-panel-id=' . $panel->id);
 }
 }else {
 if($panel->single == 1){ //if the page is single
 if($add_post){ //if the page is single and don't have any related post
 add_submenu_page('page-new.php', __($panel->name), __($panel->name), $requiredPagesCap, 'page-new.php?custom-write-panel-id=' . $panel->id);
 }
 }else{
 add_submenu_page('page-new.php', __($panel->name), __($panel->name), $requiredPagesCap, 'page-new.php?custom-write-panel-id=' . $panel->id);
 }
 }
 }

The replaced code above is actually a drawback to an older version of Flutter with a few adjustments. Notice that we have instructed the new post menus to be added within the submenu page of post-new.php and similarly the page menus to be added within the page-new.php. This effectively moves them under the corresponding navigation menu. The function is repeated because in the original Flutter menu the Custom Write Panels would duplicate in two different locations which seemed unnecessary though we are leaving you with the ability to replace them.

8 Comments

  1. David,

    Thanks for adding this feature! I’ve been looking for something like this built in to a plug-in for awhile. I’m definitely going to be switching to Magic Fields. Congrats Doc4!

  2. David,

    This is fantastic news, I have been trying for years to get the Flutter team on board with this to no avail. Thank you.

  3. Hey Doc4

    I just add this code in the Magic Fields plugin (http://bit.ly/TSK39) i just wanna say thanks for this :) (i will give credit to you in next release)

    David.

  4. David,

    I have sent a new RCCWP_Menu.php file your way, let us know if this doesn’t work. For those reading this: the issue appears to be the way the code was copied from the browser window. The copied code added ascii spaces (   ) which corrupted it. Please be sure to use the rollover “view source” when selecting the code.

  5. David says:

    When I tried replacing this code, wordpress just stopped loading completely in the browser. I double checked over and over again to make sure I was replacing the right lines of code.

    Not sure why this isn’t working. :( I hate having tons of extra buttons on the Admin Panel for each custom write panel I make.

    Any thoughts?

  6. Marko,

    I’ve sent a modified RCCWP_Menu.php file over. Please let us know if this works.

    Thank you

  7. Marko Jansen says:

    Very nice. I use a lot of Writepanels, so condensing them is useful :)

    However, when i modify the php file like you suggested, the write panels are shown in the Posts section, like they should. But, each write panel is still listed in the main menu as well, and they lead to an Object Not Found error. Do i need to modify something else as well?

  8. Thanks guys, good stuff!

Leave A Comment

Please wrap any code within the <code> tag to display properly

IE6 Upgrade Option utilizes the 7.9kb script created by mihai.ile: http://code.google.com/p/ie6-upgrade-warning/ as a WordPress plugin. I preferred this script over the many alternatives...

The WordPress Plugin: WordPress Database Backup by Austin Matzko is one of the more intuitive backup plugins currently available and with no stern warnings to scare off the faint of...

While doing our usual run of site updates and code adjustments we ran into a small issue, how to display WordPress bookmarks with both text and images. Utilizing the "Links" tab ( WordPress...

BookMaster is our answer to what we feel is an odd issue with the WordPress wp_list_bookmarks tag. For those that have exercised the use of wp_list_bookmarks you are well aware that...

Limit-Post is one of the better WordPress post content limiters we have come across both in terms of usability and size. Developed by labitacora.net Limit-Post provides excellent control...