I managed to migrate my code and enhance it into a class that anyone can simply load into their theme and support will be added.
In keeping with Shopps UI each field group is automatically added to a metabox at the bottom – sorry about that.
Get it on gist: https://gist.github.com/WazzaJB/f7c75e05a325c86dd421
Hey,
Just noticed this thread and don’t know whether what I have achieved is the same functionality you are searching for.
For the move to production, I renamed the “acf-json” folder to “fields” and had the following code run on init.
$dir = new DirectoryIterator( get_template_directory() . '/fields/' );
foreach( $dir as $file )
{
// var_dump( $file );
if ( !$file->isDot() && 'json' == $file->getExtension() )
{
$array = json_decode( file_get_contents( $file->getPathname() ), true );
register_field_group( $array );
}
}
It doesn’t import the fields, but still registers them. The benefit of doing it this way is the client can’t go in a modify fields from the backend.
Hey,
I know this may seem like a bit of a sideways solution, but have you considered using only one taxonomy? For example having a “Locations” taxonomy and then making cities children of their country?
It would make this a ton easier as you can just use the WP query to find posts by parent.
You more than likely have good reason to use multiple taxonomies, sorry if this is not relevant.
Unfortunately this location rule does not incorporate this facility. I believe you would need to create your own location rule to achieve this.
Many thanks,
Warren
Hi guys,
I created something that attempts to create column fields similar to tab fields, although they don’t currently function as sub-fields it’d be great to get feedback on how to improve this addon.
Give it a go, https://github.com/WazzaJB/acf-field-column.
Hi guys,
I too have required this and have noticed your thread.
My needs are not too great, so I focused on simply getting the ball rolling (Which seems to work great in first tests).
This version works very similar to tabs, just add a column field – select the width – and then the fields that follow will occupy the column. If you want to reset it to a full width layout then just create another column with the reset option.
It seems to work fine with tabs, although be sure to use it inside tabs, and not tabs inside columns.
I know this needs a lot more work, such as styling and stuff – but hey we can work on that!
Anyway, https://github.com/WazzaJB/acf-field-column
Let me know how it goes if anyone gives this a try, i’d love to know how/if it works with conditional logic (Although most probably not).
Cheers
EDIT: @emcniece – I really like the idea of being able to expand fields if the user desires it. I also think it would be great to get some responsive layout into this (ie: if the browser gets too small, flatten the columns) – it’s not difficult but I just want to get it fully functioning first 🙂
No problem @hube2 glad I could help, I’m sure you’ll be able to tweak it to better suit your needs 🙂
Hi there @Hube2,
I too have required this functionality today, due to being at work I am unable to test this for a variety of taxonomies although I have used it for shopp-categories.
Please let me know how you get on with this.
https://github.com/WazzaJB/ACF-Taxonomy-Depth-Rule
Wazza
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.