March 27, 2010

Using Flutter for a Restaurant Menu in WordPress

I want to share with you something technical that i've been working on in WordPress. (you don't have to read this if you don't want to I won't be offended) Also, bear with me as I don't usually write technically as much as I should. Here we go....

I've been making a website in WordPress for a local fine-dining restaurant.  Their food and wine is spectacular. Anyway, I made some custom CSS for the restaurant menu. Custom alignments for different data, etc. Not a problem for me to implement, but I needed a way for the restaurant chefs and managers to update the menu without messing with the code. I tried WYSIWYG editors, which made changing menu items fine, but adding menu items in would mess up half the time. So I decided to use custom fields with the plug-in Flutter.

However, local developer Tammy Hart has told me that soon, with the release of WordPress 3.0 that includes Custom Post Types, we might not need to rely so heavily on the plug in flutter for custom content types as we do now. That being said, I am still going to tell you what I found to be helpful in building a restaurant menu in flutter. But I thought you should know.

Here is the general CSS Layout that I've done:

I installed Flutter. I then made three "Custom Write Panels" - one for each kind of menu I have.

This makes a new items on the Admin Bar. I especially wanted this because the restaurant can "manage" and update their menus daily and wont have to dig far.

After I did that I made the specific custom fields for the Menu Item Name, The Item Description, and the Price. The three things I need to insert into my CSS to make each dish look right. And make a Field for the Name of the Grouping (appetizers, etc) at the bottom so that the restaurant can change "Entree" to "Main Course" if they want and so-on.

Now that we are all set with our fields, we can start making the template. Take your page.php file or other custom template file you have made, and after <?php the_content(''); ?> we need to call our fields.  According to Flutter's Usage: to get one variable you use <? echo get('variable'); ?> to call.  However, in our menu items, we need to call duplicates. I started using getGroupDuplicates to call all the menu items, but I ran into a problem with the items that were deleted still showing up (bug?!). that is when I found This Thread .

In the file get-custom.php add this function:

/** Developed by Thang
* Return a array with the all distinct values in one array
*
* @param string $groupName
*/
function getDistinctGroupOrder($field_name){
global $post,$wpdb;
$elements  = $wpdb->get_results("SELECT DISTINCT group_count FROM
".RC_CWP_TABLE_POST_META." WHERE post_id = ".$post->ID." AND
field_name = '".$field_name."' ORDER BY order_id ASC");
foreach($elements as $element){
$order[] =  $element->group_count;
}
return $order;
}
Than in my Custom Template I added the following (this is for the appetizers section):
<?php $group_orders = getDistinctGroupOrder('app-menu-item');

foreach($group_orders as $group_order)
{ ?> <div id="foodmenu"><dl>
<dt>
<?php echo get('app-menu-item',$group_order,1); ?>
</dt>
<dd class="price">
<?php echo get('app-Item-price',$group_order,1); ?>
</dd>
<dd class="ingredients">
<?php echo get('app-item-description',$group_order,1); ?>
</dd>
</dl>
</div>
<?php }
?>

And then you just do the same for all sections on all templates and make sure that your field names match up.

However, I want to make this fool-proof. What if on the Special Menu, they did not want dessert? Setting up the template this way assumes that these are filled out. So, I have to set up a conditional statement so that I dont get a gap displayed with no items in it. Here's how you do that- add this to your template file:

<!-- check to see if there's actually content filled in.  -->
<?php
$content = get_post_meta($post->ID, 'd-item-name', true); if ($content) { ?>

Then put in your flutter/template code in, and then add this at the end.

<?php } else { ?>
<?php } ?>

So for this "Dessert" Section, my code looks like this:

$content = get_post_meta($post->ID, 'd-item-name', true); if ($content) { ?>
<?php $group_orders = getDistinctGroupOrder('d-item-name');
foreach($group_orders as $group_order)
{ ?> <div id="foodmenu"><dl>
<dt>
<?php echo get('d-item-name',$group_order,1); ?>
</dt>
<dd class="price">
<?php echo get('d-item-price',$group_order,1); ?>
</dd>
<dd class="ingredients">
<?php echo get('d-item-description',$group_order,1); ?>
</dd>
</dl>
</div>
<?php }
?>
<?php } else { ?>
<?php } ?>

All this does is checks to see if you have fields filled out. If you dont, it just moves on.

Here is what the Custom Write Panel looks like in your page editor:

Simple huh? You just duplicate the group to make more Entres. There are also the other panels there too (appetizers, desserts, etc) So the restaurant can now add and subtract Menu Items without any fear of messing up the custom CSS. And, with the way you can label things, you can make adding a menu item pretty intuitive. (no more non-labeled Custom Field box! "value"?! what does that mean?)

Anyway, it does takes a bit of effort, but it is worth it in the long run. I wont be getting calls every time they update something and messed it up. or don't understand, etc. Flutter can be a bit clunky for beginners. (I was really scratching my head and wondering where all the simple documentation was located) But, there are some good articles out there. My friend Tammy Hart pointed me to this one on duplicate fields. And, I found this one to be helpful as well.

Here's to the wait for WordPress 3.0. and Custom Post Types.  Till then, Flutter away!

- sara cannon

March 26, 2010

Recommended Reading: “A Few Things I’ve Learned About Typeface Design” by Gerry Leonidas

Earlier this week I posed about an HF&J article on combining typefaces. Here is another article on typography. I found it to be very informative. It lays out what an instructor of typography wants to leave with his students. The Author give you six things to leave with. I found it to be a very good read. Also, subscribe to the ilovetypography.com rss. It is wonderful.

-sara cannon

i love typography

http://ilovetypography.com/2010/03/25/a-few-things-i’ve-learned-about-typeface-design/

March 14, 2010

Inspiration: MyORB

My ORB is a Design +Art studio in NYC. They did this amazing video for Hintmag in Paris after their fashion shoot. check it out.

http://www.myorangebox.com/htm2/mindtrip.html

stills from the animation:

February 13, 2010

Inspiration: Jeffrey Meyer

jeffrey meyer collage art

jeffrey meyer collage art

I really like this collage art by Jeffrey Meyer found at The Strange Attractor.

February 11, 2010

The Daily Drop Cap

Sometimes I like to highlight inspiring people who have incredible work. I've been following typographer and illustrator Jessica Hische for a little while now. She has awesome work that I love to look at and was recently featured as the Letter Cult Person of the Year.  Check out her website is and her blog. Here is her description of the daily drop cap, a internet type project she has created. (the S to the left is one of these drop-caps!)

The Daily Drop Cap is an ongoing project by typographer and illustrator Jessica Hische. Each day (or at least each WORK day), a new hand-crafted decorative initial cap will be posted for your enjoyment and for the beautification of blog posts everywhere.

Daily Drop Cap is a project I started in September of 2009 in which I illustrate a decorative letter every day (or at least every work day). The project will continue for approximately twelve alphabets and are available for non-commercial use as drop caps on your personal blog.

http://dailydropcap.com/

February 10, 2010

Inspiration: the Vardø site – The White

the Vardø site

The winners of the Europan 10 competition have been announced a few days ago. Europan is a European federation of national organisations, which manages architectural competitions followed by building or study projects. Only young European architects are invited direct their ideas and visions to issues of city development, urban planning and architecture.

Beautiful. see it here http://www.europan.no/E10/VARDØ/entries/RR004

Read the article on We Make Money Not Art

February 1, 2010

Exploration of Brand Loyalty

There are not many brands I am loyal to. I can think of only a few. However, when it comes to the brands that I am - I strongly feel that way. It makes me wonder, what makes me loyal?

Modcloth.com is a good example. I found their website via a facebook add this summer. The collection of clothing is exactly my taste. But that is not the only reason I shop often with them. Their customer service is impeccable, they have a cheap flat-rate shipping, and free returns. All of those things makes the on-line shopping experience hassle-free. I have bought and returned items, even if it "just didn't fit right" and had no problems. I've spoken to them about products, their website makes it easy to post comments, and they actually get back to you timely. They have a "rating system" that customers can post up ratings and comments about products which are helpful such as "this shoe fits a bit large to size" or "this dress is not what it looks like in the pictures. the color is darker." Having an open-forum of customer reviews and comments makes the shopping experience more enjoyable and trusting.

One of the features of their website I love most is their wish-list feature. I can add products, and always come back to them. If a product in my wish-list is out of stock, it will tell me. It will also tell me if they have only a few left. That way, if I was waiting to get a friend a present, I can snag it early before they are all gone.

I think one of the most compelling reasons for brand loyalty to me is a constant strive for betterment. Modcloth is always upgrading their website - adding more features per request of their customer base. This will truly makes a great company better with much longevity.

An example of brand loyalty (that ended up not making it) was Red Mountain Market. They were the most amazing grocer in town. They had an online-inventory where you could order groceries and get it delivered for a flat rate of $5. However, their warehouse was right down the road, so I could do a pick up instead for free. I would order my groceries, and they would be there waiting for me after work to drop by on my way home. You could make recipie lists, and order ingredients at the click of a button. all their produce was local. the squash was from one of the owner's parents farm.

They also would order items I would want. I really love cheese, so I told them what cheese I like and they stocked it. I would get it every time. The same went for more vegetarian friendly products.

The sad thing here is that no one really knew how great they were. I tried to tell everyone to go there, but most people didnt want to veer off from their traditional method of going to a store. It saddens me that such an innovative and wonderful idea did not make it. They were only open for a year. But for that whole year, I had the best food-buying experience of my life. I only shopped there.. because I was committed to making them stay in business. however, apparently, I was one of their only few loyal customers and my loyalty was not enough.

Other brands I am loyal to:

 

 

Burt's Bees - high quality - all natural with no preservatives. I will always get their shampoo and skin care products.

 

 

 

 

 

 

 

 

Apple - technology I love and trust that also has aesthetic.

 

 

 

 

 

 

 

WordPress - the very best blogging software available. Open-source and Free. They are always striving for excellence.

 

 

 

 

I could probably make a blog post about each one. What brands are you loyal to?
-sara cannon

January 27, 2010

Inspiration: Saul Bass

I am loving this truthful video of Saul Bass discussing beauty, craft, and  aesthetic VS money, time, and business. And how everything that is beautiful costs money and time to make it so - it is cheap to make ugly things.

"It's worth it to me. It's the way I want to live my life. I want to make beautiful things, even if nobody cares." - Saul Bass

enjoy -Sara

January 19, 2010

Inspiration: Color Identification System

Found this via colorlovers

Very wonderful visual color identification system for the colorblind.

http://coloradd.net/index%20EN.htm

January 9, 2010

What To Avoid in 2010 – Sara Cannon

This is from a part of my presentation "WordPress and Your Brand" at WordCamp Atlanta. Thought I would pull it out and share.

-sara

The Large Paperclip:

The Notebook:

The Office Desk:

The Notebook on the Desk:

The Ripped Notebook on the Desk with the Paperclip:

The Notebook with the Pencil:

The Pencil with the Notepad:

These things are designs of the past. Lets move on to 2010 and create unique designs that don't throw us in with a bunch of similar ones. It will be better for your brand and you!

Please comment with your own "what to avoid" and add to the list!

- sara

To See the Full Presentation go here: http://www.sara-cannon.com/2010/01/my-presentation-at-wordcamp-atlanta-wordpress-and-your-brand/

Sara Cannon is a UX/UI Designer, Former Business Owner, Creative Director, & Artist remote working in Birmingham, Alabama. 
Have a project I could help you with? Contact me at sara@saracannon.com.

Skip to content