custom taxonomies

164 views
Skip to first unread message

Daniele Milana at BCPT associati s.r.l.

unread,
Jun 24, 2010, 12:55:27 PM6/24/10
to magic-...@googlegroups.com
Hi Hunk,
tnx very much for magic-fields. That plugin is great!

Now i have a question: i need to integrate a custom panel created
with MF1.4.1 with a custom taxonomy.

I do that:
1) craate the custom panel and its gruops and field (naming it
"mypanel")
2) insert in my funcion.php
> add_action('init', 'mytax', 0);
> function mytax(){
> register_taxonomy('name', 'mypanel', array(...al values i don't
write now ...));
>}

it won't works... taxonomy "name" won't compare in mypanel menu.
To check my code i changed "mypanel" in "post" inside
register_taxonomy and it appears in post menu...

have i to look for a different action event?

Hunk

unread,
Jun 24, 2010, 11:50:05 PM6/24/10
to Magic Fields
follow the next steps:


1.- add the custom taxonomy and load css for admin:
add this (http://gist.github.com/452361) in you functions.php
note: el name for my custom taxonomy is "category_hunker"

2.- css for hide custom taxonomy for all post, in you template
directory create an archive, call taxonomy.css with this
#category_hunkerdiv{
display: none;
}

note, use #{name of custom taxonomy}div

3.- load custom javascript file only for you write panel, before read
this http://wiki.magicfields.org/doku.php?id=es:cargar_js_en_los_write_panels.
create one file for you write panel. for example my write panel is
'news', my file is news.js and content this
jQuery().ready(function() {
jQuery('#category_hunkerdiv').show();
});

This will cause the custom taxonomy is only visible to a panel write.


in the next version we hope to have ready post types, custom taxonomy,
and custom fields




On Jun 24, 11:55 am, "Daniele Milana at BCPT associati s.r.l."

Chief Voodoo

unread,
Feb 1, 2011, 1:19:45 PM2/1/11
to magic-...@googlegroups.com
Yeah ok so this is a hack so any taxonomies I add must be associated with the built in post type, post.  I get it.  How long until the next version is ready?  Will it screw up the current version?  How much money do you guys need to make it happen fast?

Also is there a way to search by post custom fields and are there any examples?

Hunk

unread,
Feb 2, 2011, 12:07:19 AM2/2/11
to magic-...@googlegroups.com
Hello we are trying to look for methods to improve the development of magic fields. you can check this topic https://groups.google.com/d/topic/magic-fields/hQhS8Woq2o0/discussion

Reply all
Reply to author
Forward
0 new messages