Jump to content

modyfying hooks of child theme


Recommended Posts

How od i modify hooks of child theme? I use classic theme as parent.

 

This is theme.yml of child theme:

parent: classic
name: steel
display_name: steel
version: 1.0.0
assets:
  use_parent_assets: false

global_settings:

  hooks:
    modules_to_hook:

      newHook:
        - ps_languageselector

  image_types:
    cart_default:
      width: 125
      height: 125
      scope: [products]
    small_default:
      width: 98
      height: 98
      scope: [products, categories, manufacturers, suppliers]
    medium_default:
      width: 452
      height: 452
      scope: [products, manufacturers, suppliers]
    home_default:
      width: 250
      height: 250
      scope: [products]
    large_default:
      width: 800
      height: 800
      scope: [products, manufacturers, suppliers]
    category_default:
      width: 141
      height: 180
      scope: [categories]
    stores_default:
      width: 170
      height: 115
      scope: [stores]

As you see, i overwritten hooks array - removed all default and aded new one i created. I also added hook tag to tpl file - {hook h='newHook'}. (By the way, I also had to copy image_types array, otherwise there was error - do i also have to copy it? Its little redundant)

The problem is - template doesnt chnges at all. In "positions" page in admin panel there are also all old hooks listed. 

I tried to set shop to classic template and then set it back to child one to "reload" it - didnt helped.

I tried to also modify theme.yml of paren theme, also didnt changed anything.

Edited by diego776 (see edit history)
Link to comment
Share on other sites

Actualization: i checked ps_hook db table and new hook is there. But as you see in config above, language selector should appear inside it. But it does not. It also appears on position admin page, but only when i check "Display non-positionable hooks".

And also - it wont work on parent theme - any modules assigned to new hook wont appear. Modyfying old hooks works fine.

Edited by diego776 (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...