Articles
Flutter: Basic Usage
We are continuing our Freshout Flutter tutorials by covering the basics of creating Write Panels, Custom Fields and methods of printing those Custom Fields. This tutorial makes the general assumption that the Flutter plugin has been downloaded and successfully installed within a WordPress plugins folder.
Custom Write Panels:
Begin by creating a WordPress category ( Posts > Categories ) named “Articles”. Note that category creation should be done prior to working with the Flutter plugin. Once the category has been created select the WordPress admin menu “Flutter” and choose “Write Panels” from the drop down list. This will take us to a page labeled “Custom Write Panel” with several options: “Browse”, “Import a Write Panel” and “+ Create a Write Panel”. This is our Flutter home page and will eventually display the sum total of our Write Panels in a single location as an easily sortable list. Continue by selecting the “+ Create a Write Panel” button which will take us to the “Create Custom Write Panel” page. This page has several options:
Placement: Determines if our Custom Write Panel will be a WordPress Post entry or a WordPress Page entry. Once the Custom Write Panels have been created they will be listed either at the top level WordPress admin menu ( or under Post / Page if using the Condensing the Flutter Menu tutorial ). For this tutorial we will be selecting “Post”.
Name: This will be the title displayed in the WordPress admin menu, keep it unique, simple and descriptive. For the purposes of this tutorial we will name it “Articles”.
Category: Selection of a category is important and since we have named our Custom Write Panel “Articles” we want to be certain any posts created by this panel are linked to the Articles category. We now no longer need to worry about category selection when writing an Articles post.
Quantity: Two options exist here: “Single” meaning this Custom Write Panel will only ever be used once and hence will not display within the WordPress admin menu or “Multiple” meaning this post will be used more than once and will display within the WordPress admin menu. For our purposes we will select “Multiple”.
Standard / Advanced Fields: De-selection of Standard/Advanced Fields is no longer required through Flutter as WordPress now provides the option for field selection from the “Screen Options” drop down located in the upper right corner of the WordPress admin area. Make sure all choices are checked.
Order: If we were creating multiple Custom Write Panels then we would want to give them an Order number. For example: to keep in line with our site menu we will set Articles as Order number “5″ and Plugins as Order number “6″. This however is not necessary as the system will always begin counting at zero.
Lastly select the “Finish” button at the bottom of the page. We have successfully created our Custom Write Panel.
Custom Write Fields
After creating our Custom Write Panel we are then taken to the individual Write Panel page, in our case the page title is “Articles”. Here we presented with the option of deleting the Write Panel but more importantly we are given two options; create a “Custom Group” which is essentially a wrapper for multiple Custom Fields or “Custom Write Field” which will not be wrapped within a group structure. Best practice is to always create a group and add fields to it, this is because we may need more fields within a group at a later time.
CREATE A CUSTOM GROUP
Name: We are dealing with the “Articles” panel so we will name this group “Article Information” .
Duplication: We will not be duplicating this field. To find our more about Flutter Duplication please read through the Flutter Duplicate Fields Tutorial.
Position: The “Add the group on the right” feature is currently buggy within WordPress 2.8 so we will skip this step. If this feature were working the Custom Group would be added to the right side of our post page just under categories and “Publish Post”. WordPress 2.8 presents the option to drag and drop fields anywhere and therefore the Position option should be removed from Flutter soon.
Once done select the “Finish” button to initiate the creation process and return to our Custom Write Panel “Articles” page. Once again we have the option to create a “Custom Group” or a “Custom Field”. Below these buttons will be a list displaying our recently created Custom Group titled “Article Information”. The next step is to add a Custom Field in order to to enter information and display it within a post. Select the “(create field)” link next to our group “Article Information” to be directed to a page is focused specifically on the Write Field.
CREATE A CUSTOM WRITE FIELD
Name: The Custom Field Name will be used within the code, let’s name it “img”. Try to keep the name a simple, single, descriptive word without dashes or underscores if the field name needs more than one word try something such as “myNameHere”.
Label: Give the Custom Write Field a Label, we will name ours “Images”. The Label will appear next to the Custom Field within the Post page as an identifier.
Can be duplicated: Our field will not be duplicated in this tutorial. To find our more about Flutter Duplication please read through the Flutter Duplicate Fields Tutorial.
Order: Start the order by numbering this as “1″ again this is not necessary as the system will always begin counting at zero.
Required: Determine if this field can be empty when publishing the Post. We have CSS provisions set in place in case the field is empty (example: the image does not exist) so we are comfortable with this field not being a required one.
Type: Select the type of field required, for our purposes we will choose “Textbox”.
Lastly select the “Continue” button at the bottom of the screen and follow the remaining instructions. For a Textbox field we generally leave the dimensions as they are presented.
Field Types:
There are thirteen field types available, however Color Picker and Slider are still buggy within the WordPress 2.8 framework. Keep in mind that just because we would like the Custom Write Field to be utilized for images does not mean it is necessary to choose the Image Type option. Think about how you or your clients will be using WordPress and the easiest way to maintain site layout while keeping it simple. In the tutorial above we are asking the user to enter the file name of the image into the Image Textbox field. For example our Image Textbox field may be filled like so: “myImage.jpg”. We know where the image is stored and have already included the location of the image for the user, the only variable is what is the name of the file. Example code:
<img src="<?php bloginfo('url'); ?>/wp-content/uploads/<?php echo get_post_meta($post->ID, 'img', $single=true) ?>" >
Let’s look at each field Type and demonstrate how to use them. In the examples below we have provided the Name and Label of each Custom Write Field.
FIELD TYPE: TEXTBOX
Name: myImage
Label: Image
<?php echo get_post_meta($post->ID, 'myImage', $single=true) ?>
FIELD TYPE: MULTILINE TEXTBOX
Name: aComment
Label: Author Comment
<?php echo get_post_meta($post->ID, 'aComment', $single=true) ?>
FIELD TYPE: CHECKBOX
Name: sold
Label: Sold Item?
<?php echo get('sold'); ?>
or
<?php if( get('sold')=='true' ) { ?>
<div class="image"><img src="http://www.mysite.com/images/myImage.jpg"></div>
<?php } ?>
FIELD TYPE: CHECKBOX LIST
Name: groceryList
Label: My Grocery List
<?php $my_array = get('groceryList');
$output = "";
foreach($my_array as $check){
$output .= "<span>$check</span> ";
}
echo $output; ?>
FIELD TYPE: RADIOBUTTON LIST
Name: answer
Label: My Answer
<?php echo get('answer'); ?>
FIELD TYPE: DROPDOWN LIST
Name: autoMaker
Label: Auto Maker List
<?php echo get('autoMaker'); ?>
FIELD TYPE: LISTBOX
Name: chores
Label: My Chores
<?php $my_array = get('chores');
$output = "";
foreach($my_array as $select){
$output .= "<span>$select</span> ";
}
echo $output; ?>
FIELD TYPE: FILE
Name: file
Label: File Upload
Location of files: wp-content/files_flutter/
<?php echo get_file('file'); ?>
FIELD TYPE: IMAGE
Name: img
Label: Image
Location of files: wp-content/files_flutter/
Note: This option is enabled under Settings > Flutter by checking the “Browser uploader” option.
<?php echo get_image('img'); ?>
FIELD TYPE: DATE
Name: date
Label: Show Date
Note: To compare dates refer to Making the Flutter Date Field Work for you.
<?php echo get('date''); ?>
FIELD TYPE: AUDIO
Name: music
Label: My Music
Location of files: wp-content/files_flutter/
<?php echo get_audio('music'); ?>
Hey Adam. Did you find a solution to using the cuntion filter where command? I also want to query posts between two different dates (which are custom fields). I can get it to query posts after today’s date, but I also want to limit how far out it goes. Any luck?
Basically got this code from WordPress
= ‘” . date(‘Y-m-d’) . “‘” . ” AND post_date
I want to change post_date to my custom field? How would I go about doing that. Tried this:
= ‘” . date(‘Y-m-d’) . “‘” . ” AND . $end_date2 .
Any help will be appreciated much!!!
@anneclaire – try disabling your Wordpress Stats plugin, Ive found that fixes the issue for me.
Adam,
Just to be clear we are talking about posts that are current, not future posts, correct?
It might be easier to use a function such as:
Be sure to set the postdates to the occurring date in the future and then display them in this manner:
Where category 1 is specific to the production posts.
Hi I’m having a little trouble trying to find the answer to this question ..
I am trying to show “Upcoming Productions” on a homepage of a website, I am using query_posts to output all the productions but I want to only show productions that are “Upcoming” i.e. they have not already passed.
I have included a flutter date field called prodn_date which i have customised slightly so it only shows the month and year e.g. JAN 2010 and I the query_posts string to only show posts where this fields date has not passed.
Here is my attempt .. any help would be greatly appreciated
Thanks in advance
Shane,
This question is better suited for the Flutter forums. Please post your question here: http://flutter.freshout.us/support/
I’ve got Flutter set up on a WP install on an IIS server. For fields of content type image, when editing posts the thumbnail does not appear, instead showing an error message like this:
phpThumb() v1.7…..
“d:Inetpubclientnameprojects/wp-contentfiles_flutter1259180662DSC_8398.jpg” does not exist
where the actual path should look like this:
d:/Inetpub/clientname/projects/wp-content/files_flutter/1259180662DSC_8398.jpg
Additionally, when viewing the output of an image, the source path experiences the same issue with regard to missing forward slashes.
http://clientname.com/projects/wp-contentfiles_flutter1259180662DSC_8398.jpg
Is there somewhere I need to change directory separators for IIS servers?
Brilliant. Thanks so much for the helpful answer Doc4. Much appreciated.
Richard,
There is no difference except how they are typed. The actual function provided by WordPress is:
<?php $meta_values = get_post_meta($post_id, $key, $single); ?>Where
$singlecan be set totrueorfalse. All that I am doing is stating the$stringis equal totruebut WordPress does not require this. To answer your other question: this is not specific to Flutter.Hi Doc4
Wonder if I could ask you another perhaps inane question please.
What’s the difference between:
<?php echo get_post_meta($post->ID, 'myImage', $single=true) ?>and
<?php echo get_post_meta($post->ID, 'myImage', true) ?>In other words, what difference does adding the “$single” make to the calling of the custom field? Is it a Flutter function or something? I ask because I’m comparing your really helpful tutorial with the Perishable Press tutorial (http://perishablepress.com/press/2008/12/22/wordpress-custom-fields-tips-tricks/) and notice this difference. I’m not sure of the distinction.
Any help much appreciated.
Kind regards
Richard
Thanks very much Doc4. Much appreciated.
Richard,
Not all of the Flutter commands are WordPress native. Calling the custom field using get_post_meta ( which is WordPress native ) is my preference over the more complicated Flutter variant but the remainder are not.
Hi Doc4
Just a quick question please regarding the code used to call/produce each field type within Flutter. Are all the php commands native to WordPress or are all/some of them specific to Flutter?
The reason for asking is that I’m keen to know whether I can use the same commands in a non-Flutter environment. For example, if I’ve created a page template which calls multiple custom field values, will those commands still work if I deactivate Flutter?
Personally I love Flutter but there are some bugs which are creating problems for me. In particular, it’s striping group titles, rendering it impossible to edit them and placing groups of fields out of order.
As always, many thanks for your help.
Kind regards
Richard
Becki,
Line #754
Add a class to the label tag above and alter it with css.
Thank you! I’m using the multiline text box interface which seems to appear at line 966; however I can’t find the string for that. I did find it for the radio button that you mentioned. Would it be a different function for the text box?
Becki,
You will need to alter the code a little in the RCCWP_WritePostPage.php file. Starting at approximately line 1419 we start to see the custom field code, 1419 is the start of the Radiobutton List and further down in the function you will see the <label for="" code. It is here that you would want to add some custom CSS. I cannot tell you which function to alter specifically because I do not know which field types you are using. This example should get you going:
Thank you so much for this helpful information – it was the only way I could get flutter working on my site. Now that I have it running, I have a question about customizing it. I created several “fields” but I want the name or label used in admin to actually show up on the post with a certain color/font (they are sub-headings). Is this possible? Do I edit the single.php file?
Hi Doc,
I figured out how to do the thumbnails:
<a href="<?php echo get("image2");?>" class="thickbox"><?php echo get_image("image2"); ?></a>where I put the max width & height for write panel image2 field as 150 x 150
It works great.
But now, I have a new issue…
I am in the process of styling my individual page template with flutter data for real estate listings, but I can’t figure out how to have a parent page that displays all of the child pages.
In other words, I have a “My Listings” page and then I have the individual property pages as child pages. The child pages are my flutter data. So how do I set up a new template that will use the same data as the child pages…and how do I get it to show all of the “listings” (but not the entire content of the child pages – just select content as defined in the “my listings” template)?
see movemaine.com
Thanks,
Jason
Jason,
The image uploader provided by Flutter does not create thumbnails. Perhaps this is where the problem stems from.
How do I go about doing thumbnails that link to a full size image automatically. I’m not sure how to use the custom code for images through flutter. Currently, I am getting just the thumbnail with. See movemaine.com
Thanks
Hi Doc 4 ! Thank you very much for your response ! Flutter with wordpress 2.8.4 made my button on the rigth admin menu desactivated… and finally I made this : return to wordpress 2.8 and reactivate flutter (because I need 1.1) and it’s okay now !
thanks again, best regards !
neurone,
I don’t believe this is possible at this time. Keep in mind some of the features are not fully functional.
HI,
I love this plugin which saved me a couple of coding hours.
I have a basic question: is it possible to create some thumb of the images i sent by flutters ?
If yes, how to do it please, i saw that phpthumb is install with flutter but i don’t find a clue how to use it except for resizing.
thanks
anneclaire,
This is the first I’ve heard of this issue. We are running WordPress 2.8.4 with Flutter 1.0.
A few things to try:
• Deactivating your plugins one by one to note if one of them is causing this
• Downgrading to Flutter 1.0 if using 1.1
Hi and thank you for your tips
I use the version 2.8.4 and the right menu on the edit post (tags/date/categories) are now unusefull (links are inactives) also the button “otions”….
I care to check on all the options on the flutter settings…
am I the only one to have this bug ?
thanks
Andrew,
To output the information from a Custom Field you will need a basic understanding of WordPress as each of the examples above need to be used within the Loop. From what I am reading everything you need is possible with Flutter and if you follow the walk through you should have the basic knowledge to create all of these fields. Is there something specific that you feel is missing? Unfortunately this is not a matter of creating a downloadable php file as Flutter requires the user to create Write Panels, Groups and Custom Fields for the database.
Richard,
The easiest method would be to use the single check box feature as in the example below repeating for the remainder of check boxes.
P.S. I’m looking for code please which would enable the user to select more than one of the checkbox options (hence my use of the checkbox list rather than radio buttons). Many thanks in advance for any help you can provide.
Hi Doc4
I’ve one more technical question if I may please, relating to utilisation of multiple selections in a checkbox list.
The current code in your instructions (the grocery list example) appear to output the precise text of each selected checkbox item. What I’m trying to do, however, is output more detailed/longer text for each selected checkbox item. In other words, the checkbox items are summaries of the longer text which I’m trying to ouput.
What I’m wondering is whether there is a code example please similar to the radio button list which, in ordinary English terms, would work like this:
If this first checkbox with this summary wording is selected, then output this more detailed wording.
If this second checkbox with this summary wording is selected, then output this more detailed wording.
If this third checkbox with this summary wording is selected, then output this more detailed wording.
Etc etc
I’d be really grateful if you were able to help me out with this please.
Kind regards
Richard
Hello, Specific. Yes. Lof of tutorials, how to create database (add fields, connect them, create bassic structure) but no one how to make it working. I mean Make output to the web. if i’m not good enough to php code, and have some exsamples (from making php template <? php blahblahblah, to easy to understant) i could make myself.. and there is a lot of … huge ammount of people who needs step by step explanation. Not Just code explanation "<img src="/wp-content/uploads/”
si if someone could create lets say template php file and explain how to make work. Beer from me guaranteed.
Making spammers database and flutter found as easy DB solution, but now confused. “i need page where all data could be outputed in lets say simple 7 tabs table or just a list of all domains with letter W and then when you press the domain you can see all this data inside.. [Website Domain][ Name And Surname][Email][Services][Phone][address][Screenshotwebsite]” if someone can do it. you can post here or to the email.
thanks for understanding and your time.
Andrew,
The information above combined with the information provided at Flutter covers everything you are looking for. Can you be more specific as to the trouble you are having?
Please help. Everyone is writing about plugin and what can do, but cant tutorials, how to output entered data. what page i need template create and etc.. maybe someone could help me… i need page where all data could be outputed in lets say simple 7 tabs table or just a list of all domains with letter W and then when you press the domain you can see all this data inside.. [Website Domain][ Name And Surname][Email][Services][Phone][address][Screenshotwebsite] i allready created fields in custom write panel. but else… totally confused
Please anyone !
Brilliant. Many thanks. Much appreciated.
Richard,
We are almost there using the example code above, we only need to add the “else” statement.
Hi again, and many thanks for your previous help.
I’d be very grateful if you could assist with an if-else combination for a checkbox please. What I’m trying to achieve is something along these lines:
- if checkbox is ticked, output this specified text
- otherwise, output this other specified text
Seems I need an if/else structure for this. Are you able to provide me with example code by any chance please? (Sorry, I need to learn a bit of php, but haven’t yet been able to).
Any help much appreciated.
Richard
Erik, Frank,
As with almost all WordPress code it will need to be placed within the loop itself. An example of a text field placed within the page code:
To use the Edit In Place feature the option must be turned on within the Settings > Flutter > Other Options > Edit-n-place. Please keep in mind this feature does not perform as well as it should, the good news is that only the logged in user has control over this option.
Nice plugin, I would like to know where to insert the example codes above?
Great plugin, though I don’t know how to make it work, followed several tuts but don’t see a way. I just want the following simple thing. Where to place the above sample code text field in a page that can be edited in place.
Tracy,
WordPress is a great solution, especially when combined with Flutter.
Hi,
I really wanted to thank you for this article, it cleared up a lot of my questions.
I wanted to ask your advise. I want to build a directory of restaurants and shops in my area. I am guessing it would have about 600-700 profiles of restaurants, each with a description & photo. I would also like to have people in the community review the restaurants. Does this sound like something that Wordpress as a CMS could handle?
I love Wordpress for blogging and would love to stay with it rather than going over to Drupal or something similar.
Thank you to anyone who might have some advice!!
hi – thanks so much for posting these tutes… helps a lot…
question:
i need a growing list of entries consisting of a linked image / text to a desired page. in flutter i have a group with 3 fields (url, title, img) & need multiple outputs on one page… so the tags in my php page template calling each entry need to be unique…
- a working example of this for _one_ entry :
ID, ‘release_link’, true) ) { ?><a href="ID, ‘release_link’, $single=true) ?>”>ID, ‘release_title’, $single=true) ?><img src="http://path/to/files/wp-content/files_flutter/ID, ‘release_img’, $single=true) ?>” alt=”listen and download now” title=”listen and download now”>
- to make it unique i know i need something with :
- but not sure how to make it all work…
any advice would be great,
thanks!
s
Richard,
Sorry for the delayed response. You don’t want to add CSS to the Label fields, we can tackle this through the output. Here you can see the surrounding div tags for multiple selections within the array.
Hi – This is really helpful. Thanks so much. I have a question please if I may. If you select the checkbox list or dropdown list field types, is there an easy way that you can create conditional if statements with php in the background page template you’re using that link to the specific selections people make?
This is the kind of example I have in mind. Imagine a checkbox list which has three alternative options. Let’s call them Option1, Option2 and Option3. The labels for the option names cannot accommodate the desired output when the option is selected because the output for each option requires structured text using CSS etc which is better – in this use case – to put in the page template being used with the specific custom write panel.
So what I’m trying to achieve is code which achieves this plain English scenario:
If Option1 is selected, then show this text [text formatted with various CSS styling etc follows in the template]
If Option2 is selected, then show this text [text formatted with various CSS styling etc follows in the template]
If Option3 is selected, then show this text [text formatted with various CSS styling etc follows in the template]
Is this possible, or does one have to stick with what the “Label” fields allow? If the latter, can you put HTML and CSS in the label fields?
Many thanks in advance for any help you can provide.
Best regards
Richard
UI Design,
Try this which can be altered to your field type:
One thing I need is a php code so if a field has nothing in it it doesn’t show.
Any body know how to do that?
thanks. It makes sense. Will proceed now that i understand the process.
cheers
I agree they could be added by the plugin though I for one would not like Flutter changing and adding directories in our site. Once you have set this up the only folder that needs to be created again during the next update will be phpthumb/cache. Previous Flutter versions could easily copy over these folders causing additional headaches.
this is what it reports:
Flutter is not ready yet. must create the following folders (and must be writable):
/Applications/MAMP/htdocs/wp-content/plugins/fresh-page/thirdparty/phpthumb/cache/
/Applications/MAMP/htdocs/wp-content/files_flutter/
/Applications/MAMP/htdocs/wp-content/files_flutter/modules/
Should this not already be part of the fresh-page dir structure?
When i tried to install fresh-page plugin it warned that i had to create a bunch of directories first?
That’s going to make a lot of people happy. really seems like there should be a wiki, right? i know that most of our collective knowledge is on the forums, but it would be nice if it were more structured.
Your a life saver!
Thanks so much,
-John