Wodrpress Plugin Magic Fields

Magic Fields: The Magic Wordpress Plugin

Types of Custom Fields.

In Magic Fields, there are 12 types of “fields”. Below is a detailed explanation of each “field” and how to use them in Wordpress.

Please note that the code used to display each “MagicField” must be inside one of the Wordpress loops. E.g. In the default theme, “the_content();” is displayed within the “single.php” file – please see the image below:

single

Textbox.

Textbox


Usage:

echo get(‘field_name’);

Return:  String.

Multiline.

For this field, the same filters used for “the_content();” may be applied using “shortcode“. Please see the images below:

multiline

shortcode

Usage:

echo get(‘field_name’);

Return: String.

Checkbox.

checkbox

Usage:

$value = get('field_name');

if($value){  /*Something*/ }

Return: Bool.

Checkbox List

check_box_list

Usage :

$my_list = get(‘field_name’);

foreach($my_list as $element){

echo   $element;

}

Return: Array

DropDown List

check_box_list

Usage:

$my_option = get(‘checkbox’);

echo  $my_option;

Return: String

ListBox

Add New Post ‹ Magic Fields — WordPress

Usage:

$my_list = get(‘field_name’);

foreach($my_list as $element){

echo   $element;

}

Return: Array

Images

image-1

Usage:

$my_image_url = get(‘field_name’);

/**

* With this method is returned the absolute url

* of the image

**/


get_image(‘field_name’);

/**is returned the image tag of html**/

Return: String

Date

date2

date

Usage:

$my_date = get(‘field_name’);

Return: String. (Return the date in the same format  to was selected when was created the custom field, actually exists 8 differents formats of dates)

Audio

Audio

Usage:

$mp3_url = get(‘field_name’);

/**

* With this method return

* the absolute url of the image

**/


echo get_audio(‘field_name’);

/**

*With this method return a flash player

* for the user can ear the song

**/

Color Picker

color_picker1

colorpicker2

Usage:

$color = get(‘field_name’);

Return : String  (hexadecimal number of the Color )

Slider

slider

Usage:

$value = get(‘field_name’);

Return: String.

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • BarraPunto
  • LinkedIn
  • Meneame
  • Reddit
  • Slashdot
  • Tumblr
  • There is no usage example for the file upload field. How does one display this field?

  • ups, i forget add this type of field…

    the File field is almost the same of audio field, i will edit this tutorial for add it.

    Thanks for the observation

  • 0k thanks. Would it also be possible to restrict the file type per field?

    Example: I have a file field and I want only .zip files to be allowed for this particular field.

  • Please keep developing Magic Fields! How can I donate to you for your work?

  • hi Kulpreet Singh

    we add a button for donation (paypal) if your donation is of another type us you can send an email

  • Your usage is mixed up, checkboxes, lists and dropdowns. It’s not working for me. It’s within the loop in single.php.

    I added for my address text field. Not showing up in the post.

    I’m using WP 2.8.4

    Thanks for any help.

  • Sorry I meant I need to add checkbox list usage to my page template. And it’s not working.

  • I’m switching from flutter to magicfields, thanks so much for your improvements! I’m still looking for one feature: how can I change the order of the GROUPS in my new write panel. They are ordered alphabetically and always above the normal fields. I want them in a special order ie. after the none group fields.

  • hi Jan.

    at the moment that functionality does not exist but we considered that it is good idea and we will work to implement it

  • how do you call all the entries of a field that can be duplicated, and is it possible to call a whole group at once?

  • hi nr

    in order to show values of a repeated field you can make something like this http://gist.github.com/199569

    I am going to create a function where it returns all the values to you of fields repeated

    about the function that returns all the fields of a group,i am working in it, will publish tomorrow it (2-oct-09)

  • ok, the function to obtain the fields of group can find it here http://groups.google.com/group/magic-fields/browse_thread/thread/d30c648b5264d28

  • I must have slipped a little. I wasn’t aware you had released a version of MagicFields. Congratulations and I look forward to trying it out. You’re already off to a great start with the instructions. Thanks for this.

  • great, thanks!

  • Great plugin! Cool! Thanks!

    Could you maybe add a ‘Video’ option for the types of field?

    Cheers!

  • Or maybe a custom category/tag list?

  • Hi Giraldi

    sound good, we will consider it

    Thanks

  • This looks like it is going to be fantastic – exactly what I am after. I’m really pleased that I stumbled across it!

  • Are the uploaded images associated with a post )using this plugin method) attached to that post just like Wp does normally? For example would the [gallery] shortcode work by displaying the images?

  • Hi Pete for show images use get_image(‘name_field’)

  • would the [gallery] short code work?

  • Hey guys, I have the same trouble in flutter and magicfields: all breaks in the multinine textfield disappear if I switch between html and visual. with some users they also disappear without switching. any idea? greets!

  • Hi,
    Great plugin!
    I want to add a title for a custom field, and I need to hide this title if the custom file is empty.
    How can I do that?
    Thanks!

  • hi jan we will review multiline.

    hi doblelick. this that you want to do is template? if it is thus, you can use something like
    < ?php
    if(get('name_field')){
    //code
    }else{
    // more code
    }
    ?>

  • hi hunk.. great plugins.. tq for your time..
    but i have a problem..
    i make an image custom field, but i cant delete it (using delete text under the thumbnail ini editing page). is it a bugs? or only mine? tq for your answer

  • Hi isni,

    What problem you have when you are deleting the image? when you do click in the image this is not deleted or when you deleted the imagen after to refresh the page the image appear again?

  • Hi

    There is still no guide for how to deal with file uploads, neither does there seem to be a function for getting files.

    I have also tried to simply use get(‘field_name’) but that returns nothing.

  • first of all, great news that flutter is rising from the ashes. ill be following this development eagerly.

    with regards to nr above, returing duplicate groups or duplicate fields has always been flawed in flutter, because when you delete a duplicate then add another duplicate it throws the whole order out.

    there is a good fix by thang and nick keenan on this page.
    http://groups.google.com/group/flutter-support/browse_thread/thread/904038d01c85ac8c/fa0acab9c99504ae?lnk=gst&q=i%2B%2B#fa0acab9c99504ae

  • How come the anchor buttons don’t work in the multiline editor?

  • Nevermind guys, I messed up.
    Keep up the good work!!

  • Hi Guys, great plug, image upload actually works unlike flutter. Still can’t get api for file upload to work. Hunk’s wiki link says it’s just get(‘pdfupload’) but I get this “http://localhost/www/burnt%20pine%20weddings/wp/wp-content/files_mf/file.pdf”, the actualy path, I need a link to the file.

    I also tried get_file(‘pdfupload’) but no luck, can someone please clear this up, as this is vital info. thanks

  • Good to see some further development of flutter.

    Feature requests:
    image associated with checkbox
    google maps field
    youtube field
    xml export or integration with feed wrangler

  • Hi,
    Sorry if this is a dumb question. I need a list option, either list box, check box, drop down. Its not important. Which only permits 1 selection. Is that possible ?
    i.e. if pretend its a list of measurements. if they select gram. Then Kg or litre cannot also be selected.
    Many Thanks

  • Hi
    Again sorry for another dumb question. Is it possible to remove the default Upload / Insert Box Wordpress gives. All of the fields are specified as your fields. I do not want the default. Is this possible.
    Many Thanks for any help.

  • Hiya
    Thanks for this great great plugin! It’s very helpful. I’m wondering though, how do I add an alt tag to my images?
    Thanks

  • @emma use alt=”

    Thanks for this plug-in, just spent all day struggling with flutter then found this!!

    Should note on this guide not to copy and paste as get_image(‘field_name’); should be get_image(‘field_name’);

  • Currently i am using is amazing plugin. Why draft posts are not showing in manage section of respective custom write panel?
    While i do a draft using any write panel, it doesn’t show in respective custom write panel manage tab. I can only see that in default edit posts page.

  • Hi there

    ive got a question about the Checkbox list – i got it to echo all the options in the page template, but HOW do i echo ONLY the ones that have been ticked??

    any help would be appreciated. thanks!

  • Love the plugin so far, great work you guys. I used PODs on a previous site and I like that as well, but I like the simplicity of this plugin. I do have a small question though. Is it possible to create field a that has 2 values or input fields?

    For example: Let’s say I want to show a list of Services. For each service there is some text and icon. I am imagining hitting the “duplicate” button in the panel and 2 fields are generated; One for the icon url and the other for the text. Is this possible?

  • Never mind my comment above. Got it figured out, I totally overlooked the “Groups” option, which is very powerful. :-) Thanks for making this!

  • First off I’d like to say great job at making a better version of flutter, its nice to see the plugin will live one.

    One thing that would be nice is to put all the documentation at the top of this page. I had to skim through all the comments to find the function to obtain all the fields (with values) of a group.

    Cheers

  • Hi,

    You are right, we are thinking in give a new skin to the magic fields page… we will take in account your suggestion. for to in the next version of the page all will more easy to access.

  • Hi Gnuget and Hunk

    been looking around and this is still the most versatile custom write panel plugin around – keep up the work!

    ONE question: is there any way to either:

    1) use the “Related Type” with a list of checkboxes rather – ie list the pages created by another write panel?

    2) use the “checkbox list” but instead of inputting the options, rather reference the pages of a particular parent page?

    I think this would be a powerful feature – eg you could tick, from a list, all the PRODUCTS that a certain SUPPLIER stocks (where PRODUCT and SUPPLIER are custom write panels.

    is there any way to do this / possibility of it being implemented?

    thanks for the great plugin!

  • Quick question, is it possible to integrate Pagination with content populated by Magic Fields?

    For example; I have a simple “News” area that is setup via Magic Fields and set to Post for Placement. Basically the idea is to have a page that displays 10 “News” Posts and then has pagination to navigate through the posts.

    I realize this can be done easily by just making making a “News” category under the WP posts; but I am trying to keep away from doing this as I want the blog section of the site to be controlled by that.

    Thanks!

  • @dan use a category but exclude it from your blog loop

  • @tom – I’m not sure I am following you a 100%. I tried doing the above (my previous comment) with just the traditional post and assigning it to a category, to which I ran into a bit of a snag. Here’s an idea of what I’ve got.

    I have 5 main pages, most have sub pages. One of these main pages is “About” with a sub section of “News” … on this “News” page I’d like to display Posts from a certain category, which I did. But what I don’t like is how when you click on “Continue Reading” to read the full “News” post it uses the “single.php” template.. I could just modify the single.php template to look just like my “News” subpage, but I really don’t want to do that. What I’ve been searching for online is something related to Assigning Posts to Pages. But from what I understand it’s not possible? I found a couple plugins but they didn’t do what I wanted.

    I’d really like this to be powered through Magic Fields if its possible. The biggest disconnect I am having is when you are on the “News” page (subpage of About) you see a list of “News” posts and when you click on an individual post you are still in the same template as “News” and the URL would be something like “www.mywebsite.com/about/news/name-of-post”

    Sorry for the novel. haha. Any thoughts on how the best approach for this? I push for Magic Fields simply because a full on blog will be added to the site later on and I REALLY want to keep all “blog” related content separate.

    Thanks!

  • http://www.webdesignerwall.com/tutorials/wordpress-theme-hacks/

    look here for ‘Unique Single template’, I’d certainly go this way,unless you had a particular reason for wanting to use a page.

    I’d rework the link structure and use a custom category template for your category (eg category-news.php) then set your category structure to something nondescript but relevant, for example on my site I have

    http://www.mysite.com/website-design/portfolio/site-i-designed

    where /website-design/ is used instead of /category/ (change in permalink settings) /portfolio/ is the category (controlled by magic fields) and /site-i-designed/ is the post using a custom single.php also configured to %%title%% in permalinks. Then for your blog edit index.php to exclude news category and use the default single.php

    I’d stop search engines following by category after this but that’s really a matter of the site you have and I’m certainly no SEO expert.

    cheers :)

  • should say …category permalink structure to something nondescript……..

You can follow any responses to this entry through the RSS 2.0 feed.

Trackbacks / Pingbacks