Wodrpress Plugin Magic Fields

Magic Fields: The Magic Wordpress Plugin

Getting Started

This tutorial will be explain the basic use of Magic Fields, how create write panels, how create custom fields and how print in the template.

Installing Magic Fields.

Magic Fields is installed as any wordpress plugin, you just need download from his download page, put the folder in:

wp-content/plugins

And in the admin area in the plugins section do click in the “activate” link and its all.

When you active the plugin the first thing to Magic Field ask is for create two folders, this folders are:

/wp-content/files-mf /

and

/wp-content/plugins/Magic-Fields/thirdparty/phpthumb/cache

Is enough to you create these folders and give them enough permissions for be writable by Magic Fields

Now we are on road for start to use Magic Fields!

Basic Usage

The best way to understand how Magic Fields Works is with a example, in this example i want create a portfolio of my work. So, the first thing to do is a create a category called “portfolio” and after that create our write panel and assigned the category “portfolio”

Add a new write panel

Add a new write panel

Write Panels ‹ magic_fields — WordPress

In the write panel page exists many options, this options will be explained more a detail in the future for now i just leave the options by default.

Write Panels ‹ magic_fields — WordPress-1

After to create the write panel I’m going to add custom fields for this write panel, for now I will create just one custom field for add the services to I gave to the client.

create_field

Write Panels ‹ magic_fields — WordPress-2

In this page I can choice what type of custom field I want in this case I want a textbox field, and I give the name of “services” and the Label of Services.

I don’t want to this field be required and I don’t want to this field can be duplicated. (the duplicate featured will be explain in detail in the next’s posts)

And it’s all now we can enter to the portfolio panel and now we can start to create content.

Add New Post ‹ magic_fields — WordPress-1

We can view our post created with our write panel in the “Manage” option.

Edit Posts ‹ magic_fields — WordPress

Displaying our information in the template.

Well now we need display the information to be added in our template, for that Magic Fields give us a little api for this. Lets go.

In our single.php file we can add this:

echo get('services');

And it’s all.

Now if we visit the post we will see the information to we put in the services field.

Client name « magic_fields

Exists many more things to we can do with Magic Fields, in the next’s posts I will talk about the differents types of fields.

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • BarraPunto
  • LinkedIn
  • Meneame
  • Reddit
  • Slashdot
  • Tumblr
  • Hey, I’m adding echo get(‘highlights’); to the php in my template. I don’t see any my text being displayed tho.

  • The name of the custom fields is case sensitive, please check to your custom file is called “highlights” and not “Highlights”

    Another thing is the “get” function just works inside of the loop ( http://codex.wordpress.org/The_Loop ), please be sure to you get function is inside a loop.

  • ah, yes, looks like it was capitalized.

    I am having another issue. I have added to 2 magic fields to the write panel. The main content edit field won’t let me switch back and forth between HTML and Visual. It’s stuck on visual and won’t save anything I put in there. It does work with one magic field.

    On the magic fields the html tab works, but there isn’t an edit bar.

  • –edit–

    TinyMCE Advanced is conflicting to cause the first issue.

    The HTML tab is still missing its tool bar tho.

  • Hey Bobby.

    this is a bug, thanks for reporting.

    Edgar is working on this.

    we will deliver a new version in one week this issue will be fixed

  • My suggestions are:

    - Don’t fork Flutter. It’s not as intuitive as Pods. Flutter also tries to piggy back on the Posts system, which makes it confusing, and you could do well to do it the Pods way or create your own kind of system like Pods.

    - Drop TinyMCE and go with nicEdit. It’s a similar editor that gets the job done and with far less hassle.

    - Always keep in mind the interface intuitiveness for not just the developer who may wish to use your system, but in the client interface. You may encounter a client who just doesn’t understand all the bells and whistles of WP, nor Flutter, but may understand Pods a little.

  • Volomike,

    About to don’t fork flutter. we really think to Flutter is a good idea but with some issues.

    We create a fork of flutter because we want fix all these problems to flutter has, if you think to flutter is not intuitive we will fix that issue in the future.

    MagicFields for now is very similar to Flutter but now we have our own path of development and in some versions in the future this project will be very different of flutter.

    About to drop TinyMCE, we don’t want leave Magic Fields bloated, we will take advantage of all code of wordpress already have, using tinymce we avoid add a another WYSIWYG editor for the plugin.

    And about the intuitiveness, you are right, we will pay attention to this aspect.

    Thanks for your feedback.

  • Ok so i personally think it’s great news that somebody has decide to push this project forward. I have been using flutter for some time now because it’s the only plugin that will add a nice media uploader for my clients to upload a thumbnail for a post.

    @Volomike flutter or magic-fields is completely different to pods.
    Magic-fields is a good way to handle meta-data attached to a post whilst still remaining in the post page paradigm.

    I love pods it’s one of the best plugins ever, that’s why i use them for what they were built for: handling alternative content.
    For example say a business directory.

    Ok so anyway i tend to have to make this correction every time i set up a new install, i wonder why you guys haven’t applied this fix yet by the way.
    http://www.doc4design.com/articles/flutter-condensed-menu/

    also in the latest release (1.1) maybe also the previous one, after creating a write panel, i create a group and a field in that group. the new group apears but empty and the field appears above in the default panel (magic fields custom fields)

    keep up the good work people.

  • And to say pods is in anyway more intuitive than flutter or magic fields is just plain insane. No page wildcards or page templates database queries etc.

    Your client should not be able to see the pods menu or the flutter/magic-fields menu anyway (Adminimize).

    Ok your client will still have to handle the fields in the post page if that’s what you meant but theres nothing difficult there. the uploader (image) in my case is actually more intuitive than the one packed with wordpress.

    so one again crack on guys.

    by the way a good thing would be to fix the integration with worpress mu as the menuing side of thing just seems to get screwd up.
    the master admin menu(top left one) in the wordpress mu admin disapears on plugin activation.

  • Hi GUys,

    Ok…. new to WP but not CMS. I guess when I jumped in I went deep with Joomla. BUt needing to steet up a much simpler sight only for event dates.. I decided on WP. Now I have tried the Custom Fields, Flutter and have wound up here at Magic Fields.

    Now my although I have been unable to recall the fields individually (I am still trying though, I’ll get it.), my question is…

    Is there a way to call up a “GROUP or GROUP ARRAY” of fields with one (1) line of code that I can slip in to the content loop on the page? I mean Magic Fields allows you to create a group, in my instance “”Event Detail” with several fields for that group.

    Also should I maintain an “all lower case format” when I name a group or field? Obviously I can use caps in the “Label” text. but for background purposes should these names be all lower case?

    I hope I made my self clear.

    The site is in testing at csup.deliamultimedia.com.

    I would like to have the fields displayed under the title.

    I am also trying to work on removing the “posted date” in that little colored box in the upper left corner and put the event date there.

    Thanks in advance.

    JD

  • Hello all, first time using magic fields. Is it possible to upload videos? if yes, which method should I use to upload it?

  • No, for the moment not exists a custom field for upload videos, but is easy creating one, using a custom field textbox and when you create a post put in your textbox field the “embebed code” of the video, and should be works fine.

    Exists more fancy solutions like you can just asking for the url of the video and in the frontend put the embeded code and just replacing the video code for the value of the custom field.

    In this way you can put videos of youtube, vimeo or flickr in a easy way

  • David, Edgar,

    First I’d like to thank you both for a great plugin.
    It all seems to work smoothly but for some reason it will not display my duplicated fields. I have my get-tags written in the loop so I can’t figure out why these don’t show. Any suggestions?

    Thanks,

    Emma

  • @Emma.
    Hi Emma check the thread below for duplicated fields and see if any of those methods work for you. http://groups.google.com/group/magic-fields/browse_thread/thread/19c4a5b03662f740

  • Hi, does anyone know of a good plugin to manage the Admin Panel Menu ?
    I am already using Adminimize to remove some menu items, but I would also like to change some labels and be able to change the hierarchy (for example put some Magic Fields panels inside the same menu, etc.)
    Thanks in advance,
    Lic. Adrián P. Eidelman
    Director – BlueSoft, tecnología de vanguardia para su empresa
    http://www.bluesoft.com.ar
    Tel.: +54-11-4983-9534 Cel.: +54-11-15-6158-7321

  • Hi,

    Anyone know how can i run a check to see if a group exists (groupGallery) and if it does exist then create an object for each group (groupGallery).

    The object (groupGallery) will simply be a series of list elements containing:

    get(ImageTite)
    get_image(‘ImageThumb’)
    get(‘imageDescription’)

    hope that makes sense! – i have also posted this on the google groups forum.

    Thanks

  • Is there any way to place the output of these fields INSIDE the content for a post/page? eg. shortcode?['services'] or something like that? In evaluating this before use, that’s the limitation I see — that the function get(’services’) means it must be in a template and that it can only be display before or after the_content() or excerpt or whatever….

    would love to know if it’s in there OR planned for the future, thanks!

  • Casey.

    Actually doesn’t exists that feature in Magic Fields, but, sounds good we will be think about this.

    But actually is not difficult in your functions.php put something like this:

    http://gist.github.com/212796

    Our concern for make this feature is when the user has a shortcode with the same name of some custom field.

    David.

  • Thanks… where do I put the function? In what file?

  • doh! nevermind, I see where…!

  • Well,for any doubt put the code in your functions.php of your theme.

    :)

    http://codex.wordpress.org/Theme_Development#Theme_Functions_File

  • which is better? Magic Fields vs Flutter? Why not just contribute to Flutter, seeing as both plugs are trying to do the same thing?

    Hopefully next version of wordpress will incorporate all developments into a first party feature. Worth throwing a party, indeed.

    i don’t mean to patronize. The plugin is kick-ass.

    Also, check out this plugin for that mediocre CMS expression engine. Some nice features that Wordpress should incorporate:

    http://brandon-kelly.com/fieldframe/showcase/bundled

    Looking foward to more developments

  • Hi Lane, for more information it reads this (about) http://magicfields.org/about/.

  • First, I’d like to thank you for creating this plugin, it’s awesome. Just what i needed for a new website I’m building.

    I’ve just suceeded with the whole thing to get duplicate groups to display. I read the maual in spanish (i know a bit of spanish). There is one thing I’d like to know still.. I would really like to wrap each group in a DIV, so i can style the groups separately and so on. How do i do that? I’m pretty new to Wordpress and PHP in perticular, so there is probably an easy way to do that right?

    Here is how the code looks in my page.php, inside the loop.

    <?php

    $albums = get_group('album');

    foreach($albums as $album){
    echo "”.$album['album_name'][1].”";
    echo $album['album_songs'][1];
    }

    ?>

  • First, I’d like to thank you for creating this plugin, it’s awesome. Just what i needed for a new website I’m building.

    I’ve just suceeded with the whole thing to get duplicate groups to display. I read the maual in spanish (i know a bit of spanish). There is one thing I’d like to know still.. I would really like to wrap each group in a DIV, so i can style the groups separately and so on. How do i do that? I’m pretty new to Wordpress and PHP in perticular, so there is probably an easy way to do that right?

  • Great Great plugin
    Only thing is that the get_field_duplicate doesn’t filter empty fields hence need to do a messy workaround to exclude and not echo it

  • Hi Coola.

    thanks for your comment, I have reviewed the way in that query becomes and have fixed this.

    if you wish to have these changes in your version it changes the following lines

    in file get_custom.php

    for function get_field_duplicate line 481 replace $sql for this http://gist.github.com/248850

    for function get_group line 384 for this replace $sql for this http://gist.github.com/248849

    and check again.

    I only add a AND pm_wp.meta_value <> ”

  • work like magic.
    Thanks hunk – much appreciated.

    Noa

  • One thing that I would like to see added is the ability to add some of the fields to quick edit? is their away to do this?

  • First, Thank God someone is forking Flutter and de-bloating it. I believe Flutter development has picked up again, but the de-bloating was necessary.

    Second, what if anything are you doing to embrace custom post_types? This would bring some of the PODS capability although still using the post table. It would also allow write panels based on post_type instead of “categories.” This appears the direction of Wordpress. Lastly, do you know what is breaking MagicFields in MU? I have a single blog setup of MU and am wondering if it will still present a problem?

    Great work and thanks. If I use MF, I will certainly donate.

  • I installed your plugin in the 2.9 version and i had problems displaying a carousel of posts made using jquery a jflow. When I disactivated evertything went back to normal.

  • I’m sure is a javascript issue, can you check your javascript console and paste here the displayed error?

  • Hi,

    I wonder if it is possible to sort the content of a “Related Type” field…
    It would be nice (for usability purposes) to display the “drop-down” ordered by post_title.

    Cheers!

  • Hi there:

    First thanks for the fork, I thing it was needed. I think I found a bug so I am reporting.

    Specs:
    Server: LAMP
    WP 2.9.1 (although it also happens in 2.8.4)
    Magic Fields 1.3.1 (also happens with last flutter version)

    SexyBookmarks 2.6.2
    Sociable 3.5.2
    YARPP 3.1.3

    It happens that when you use a Multiline Textbox type of field the plugins listed above (at least) insert themselves in between the custom fields you created with Magic Fields (one time for each Multiline Textbox field).

    It seems that this kind of field inserts something that this plugins are lookin for to identify where to be ineserted, it may be easier to just change something inside MAgic Fields than getting them all to modify theiri code so…

    (I have had to change my Multiline Textbox to simple textboxes for the moment as I can’t find out a better solution by myself)

    Great plugin guys, thanks in advance.

  • Great plugin. I had been looking for something similar, but I just never got around to actually searching. It’s great how easy you guys made it to create a panel and insert the content on to a page / post. I’m looking forward to getting out of code entirely when editing content and it looks like I’m very close.

    Thanks again!

  • Hello!
    I love this plugin! Thank you so much!
    I am having trouble with acess though. I need to grant access to author, but I can’t manage to get that. I am using Role Scoper. I even tried Role Manager. I unchecked and then checked the case Assign to Role case but it does not work. I deactivated Role Scoper and also Adminimizer and still no access to the form for the author.

    Any help would be much appreciated because I have spent much time on this now.

    Thank you so much!

  • Oh I think I got it!!!
    Yeah! :)

  • I am using multiple post types which ideally will be displayed on the same listings page, these will be displayed differently so i need a way to be able to tell what type of post it is in the loop so i can use different markup. How can i see what write panel the post was created with? Cheers in advance.

  • Valerie try this , worked on flutter for me.

    Capability Manager
    http://alkivia.org/wordpress/capsman/

  • Great plugin.
    Well i need to ask a lame question, please tell me how to delete the custom panel created via Magic Field.
    I have looked at all the options but delete action is not available.
    Do i have to edit the core files or is there some method call for deleting a custom panel.

  • Got the delete link, sorry to bother you.
    But please make that link under Custom Write Panel actions heading in your next versions.

  • Hey, I think I figured it out!

    It looks like “Magic Fields” is a replacement for the default “Add New” link. What I did was check the “Condense Menu” option in Settings. Then I used the “Adminimize” plugin to remove the default “Add New” link.

    Now when the editor creates a page, they click on my Custom Panel (then proceed like they did with “Add New”).

    Does that sound correct?

  • Hi, I just tried installing, it prompted me to create the files_mf folders, which i did, then complained that it couldnt creat a css file in the file_mf folder (note that there is no plural in the second prompt). I’ll take a look at the code and see if i can figure out which directory is correct, unless i hear from you first! thanks.. oh, also when installing the plugin it prompts you to create phpthumbcache, but in your installation instructions you say to create phpthumb/cache, again can probably track it down but would be nice to have the warning or directions consistent. thanks!

  • Hi Mike H.

    you can use get_panel_name() function

    //code in my template
    $name = get_panel_name();
    if($name == “news”) include_once(‘news_template’);
    elseif($name == “articles”) include_once(‘articles_template’);
    else include_once(‘default_template’);

  • Hi Amos, yes the route is files_mf and phpthumbcache

  • I’m having trouble with duplicate content. I created a write group with several fields and added those to my page as instructed with the get function. However, what displays is the default wp custom fields (with the key as opposed to the label) and below that is the Magic Fields custom fields (with no label).

    Here is a sample post showing the problem:
    http://recreationalinvestment.com/motorcycles/test-post/

    and here is the code I entered:

    Any help would be appreciated as I am pulling my hair out and already late on delivery of this site to the client.

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

Trackbacks / Pingbacks