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.

UPDATE: For more information about Magic fields visit the wiki

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • BarraPunto
  • LinkedIn
  • Meneame
  • Reddit
  • Slashdot
  • Tumblr

105 Responses to “Getting Started”

  1. Gnuget says:

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

    :)

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

  2. Lane says:

    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

  3. hunk says:

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

  4. 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];
    }

    ?>

  5. 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?

  6. Coola says:

    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

  7. hunk says:

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

  8. Coola says:

    work like magic.
    Thanks hunk – much appreciated.

    Noa

  9. Sarah says:

    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?

  10. 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.

  11. jorge says:

    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.

  12. Gnuget says:

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

  13. Bruno says:

    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!

  14. Javier says:

    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.

  15. 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!

  16. Valerie says:

    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!

  17. Valerie says:

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

  18. Mike H says:

    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.

  19. Blowsie says:

    Valerie try this , worked on flutter for me.

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

  20. Deepesh says:

    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.

Leave a Reply

Stop SOPA