Giter Club home page Giter Club logo

Comments (4)

 avatar commented on July 19, 2024 1

thanks @MWDelaney.

  1. I see that you can filter out default content blocks, but I didn't see how you planned on allowing other plugins or the theme to filter in content blocks. But I did notice that you're latest version has less default blocks, so maybe it's there and I'm not seeing it.
  2. I would also want the ability to filter 'Hide on Screen.' We almost always remove the main visual editor and use Flex Content as the entire layout builder.
  3. With regard to #2 , this plugin has a feature where if you select a visual editor as one of the content block choices, and there was content saved in the WP default visual editor, you can choose to copy it over. It's a pretty nice feature if you have legacy.

-Rich

from acf-flexible-content-blocks.

MWDelaney avatar MWDelaney commented on July 19, 2024

@secretstache I'm happy to discuss features and here's as good a place as any. What do you want to talk about?

from acf-flexible-content-blocks.

MWDelaney avatar MWDelaney commented on July 19, 2024

These are great suggestions. Much of this plugin has been developed so far with a "I need feature X for my current project so I'll add it" mindset, so it's always great to have a wider view like the one you've provided here.

One at a time:

1
It's possible to extend the layouts class to add a block type. It's not well documented yet as I'm sure that I'm not doing it as cleanly as I could be, but here's what I use to add a project-specific block type:

Please note that this is super thrown together and probably very poorly executed.

/**
 * Add 'Header' layout to FCB layouts
 */

class addMyLayouts extends ACFFlexibleContentBlocks {
  function __construct() {
    add_filter( 'fcb_add_layouts', array($this, 'my_layouts'), 10, 2);
  }
  function my_layouts($layouts_array) {
    return $this->insert_the_layouts('myLayouts', $layouts_array);
  }
} new addMyLayouts;
class myLayouts {
    /**
     *
     * Flexible Content Field: Header
     *
     * @author Michael W. Delaney
     *
     */
    function header() {
          $FCBFields = new FCBFields(__FUNCTION__);
          $FCBRepeaters = new FCBRepeaters(__FUNCTION__);
      return(
          array ( 'order' => '1000',
          'layout' => array (
            'key' => __FUNCTION__,
                'name' => 'header',
                'label' => 'Header',
                'display' => 'block',
                'sub_fields' => array (
                    // Title
                    $FCBFields->title(),
                )
            )
        )
      );
    }
  }

2
I typically accomplish this with an action rather than with ACF's "Hide on Screen" functionality.
Example:

add_action('init', 'remove_content_editor');
function remove_content_editor() {
    remove_post_type_support( 'page', 'editor' );
}

I'd be happy to look at a PR for this functionality, though.

3
This is a great feature, but not one I am currently planning to implement. This is another case where I'd be happy to look at a PR if you wanted to submit one.

from acf-flexible-content-blocks.

 avatar commented on July 19, 2024

thanks @MWDelaney we're going to start by building a plugin that adds content blocks into your setup. We'll pass along info soon

from acf-flexible-content-blocks.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.