Altering semantics only if in compound content type
Submitted by sanderaido on Fri, 09/22/2017 - 19:20
Forums:
Hi!
Is there any way to check whether the content type is "inside" another content type and alter it's semantics accordingly? For example change some default options of Fill in the blanks but only if it is inside a Column type. The h5p_semantics_alter hook doesn't seem to have any context about where it is run, so is this possible at all?
I'm using Drupal 7. Something like:
function mod_h5p_semantics_alter(&$semantics, $machine_name) { if ($machine_name == 'H5P.Blanks'){ // Check if parent/context is 'H5P.Column' // alter $semantics } }
Cheers!
Content types:
icc
Mon, 09/25/2017 - 10:07
Permalink
Hi, Unfortunately, there is
Hi,
Unfortunately, there is no context. To achieve what you want you'll probably want to add a custom editor widget for the Column, where you can customize things to your liking.