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

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 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/

January 9, 2010

My Presentation at WordCamp Atlanta – “WordPress and your Brand”

Thanks for everyone who was able to attend my presentation on WordPress and Your Brand at WordCamp Atlanta! Here are my slides and the U-Stream of my presentation. I am going to post a blog post about some of the things I have covered soon as well!

a snippet taken by joe hamm

December 29, 2009

Post from the WordPress iPhone app

Pic of instalation... More to come! Testing iPhone WP app features... I'm a nerd.

- Sara

December 15, 2009

Speaking at WordCamp Atlanta Jan 8-9

I'm speaking at WordCamp Atlanta!Thanks to some encouragement from Tammy Hart, I decided to apply to be a speaker at WordCamp Atlanta. I had spoken at WordCamp Birmingham in September and had a wonderful time. I always feel like I get so much out of WordCamp. Not only from everyone sharing so much of their knowledge but from meeting some incredibly talented people.

Coming from a design background rather than a programming one, sometimes I am a bit intimidated by speaking. When it comes to advanced php I feel like I'm more of a learner than a teacher - but when it comes to aesthetic, I feel like I have a lot to say. I am going to be speaking on something that is a passion of mine: "WordPress and Your Brand."

Brief Description of "WordPress and Your Brand":

"Utilizing WP technology to fit your brand, your look, and your goals"
We will be covering different aspects of WordPress and how it applies to company branding. We are going to look at good branding practices, examples using wordpress, and look into how we can give ourselves and our clients the best possible online presence. We are also going to talk about brand consistency online and offline, WordPress customization tips, and helpful Plugins.

"Adapt WordPress to your brand, not your brand to WordPress"

Anyone have any amazing examples of Design, Branding, or Interactive Branding they would like to share?

If you saw me speak at WC Bham this year.. its going to touch on some similar branding focuses, but it is going to be a million times better and very in depth talk about aesthetic, type, etc. I am so excited to hear all the other speakers and meet new friends in the tech community that weekend. Cant Wait!

sara

October 5, 2009

Wordcamp 09: “WordPress and Your Brand”

At Wordcamp Birmingham 2009, I had the privilege of speaking on WordPress and Your Brand. I have embedded the slides from the talk. I hope that some people were able to learn a bit about "adapting WordPress to fit your brand rather than your brand to WordPress." I absolutely loved Wordcamp and can not wait for the next one.

WordPress and Your Brand

View more presentations from saracannon.

Sara Cannon Wordcamp 09

photo by: Jason Wohlford

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