Core Block Override within Package

Permalink
I'm trying to manipulate the core "content" block within a package. Particularly, the editor_config.php file that resides in the concrete/blocks/content folder.

I've added a blocks/content/editor_config.php file within my package directory, but it doesn't seem to be picked up like a traditional override in the root. Am i missing a step, or is this functionality just not available?

If not, are there any suggestions on how to achieve these kinds of overrides with a add-on?

-Guy

guythomas
 
mkly replied on at Permalink Reply
mkly
Are you doing this with only the content block? Any attributes that use tinyMCE use concrete/elements/editor_config.php not the block one. I think the same goes for composer.
guythomas replied on at Permalink Reply
guythomas
I'm doing it with both. the elements/editor_config won't override from the package directory either.
mkly replied on at Permalink Reply
mkly
Someone may correct me on this but I don't think elements ever checks the package folder.

This is the method in /concrete/libraries/loader.php line 109
public function element($file, $args = null) {
  if (is_array($args)) {
    extract($args);
  }
  if (file_exists(DIR_FILES_ELEMENTS . '/' . $file . '.php')) {
    include(DIR_FILES_ELEMENTS . '/' . $file . '.php');
  } else if (file_exists(DIR_FILES_ELEMENTS_CORE . '/' . $file . '.php')) {
    include(DIR_FILES_ELEMENTS_CORE . '/' . $file . '.php');
  }
}


I came across this trying to override header_required.php in a package. Never really came up with a solution I felt was good for it.
guythomas replied on at Permalink Reply
guythomas
Yeah, I'm thinking the best way to do this may be at the javascript level. Re-initialize the tiny mce window with my own parameters.

-Guy
mkly replied on at Permalink Reply
mkly
If you post anywhere about tinyMCE like this I'd love to hear about it. I've wanted to dig a little deeper in this stuff.

By the way, you're Facebook block tutorial was one of the first things that really helped me when learning to make blocks. Thank you for making that.
guythomas replied on at Permalink Reply
guythomas
Will Do, I'm trying to build an add-on that allows editors to add google web fonts to their website through the normal content editors.. I succeeded in the development, but am now stumbling all over the place trying to package it.

I'm glad you got something out of the facebook tutorial, I really need to revisit that one though, facebook completely changed their api and I'm not even sure if that code still works!