Fork me on GitHub

Watch

GitHub Core

Show your support for Zikula! Sign up at Github account and watch the Core project!




GitHub Modules

Forum Activity

Forum feed

» Visit forum | » View latest posts

Post Nuke Hooks Feature Request  Bottom

  • Hello,

    I am working on some modules that will call hooks and I have come across the need to be able to control which hooks are called on a page. I wanted to know if the pnDev team might add functionality to the hooks code that will allow the admin to turn off a hook call to one page in a module but allow it to be called on another page in the same module. I was thinking that when a module that registers a hook is activated in another module that the display hook can initially provide a link that will say 'Register Page'. Once the page is registered the admin can enable which module hook will be called. For example. I want EZComments on this Page but not Ratings even though Ratings is enabled for the whole module. Ratings is turned on for a different page in the module. Also create hooks would automatically register themselves the first time they are called. That will allow the admin to turn on or off the create hook for any given instance it is called in any module.

    I believe these changes would allow more flexibility for an admin to use other modules to extend their site.

    Thanks
  • Amen to this. I see that this was posted almost 2 years ago, so maybe it's forgotton. This is a big issue with my current site, in which we want to display *2* hooks in different places. It makes no sense on our site to just dump out all hook output in one place, with no guarantee that they will even be in a desired order. I have two suggestions:

    * Add a parameter in which a specific hook can be displayed or excluded; just add another parameter to the function and test for a match as it loops through the hooks;

    * divide the display output function in two: the first function is exactly as the current one except it comes back in an array, with the key value being the module name of the hook, i.e., "EZComments". This way each hook output would be neatly partitioned from the others. The 2nd function would output the the results of the hook call; either a specific element in the array, exclude a specific element in the array, or the entire array. The default would be the entire array, so the two functions together would be exactly what we have now. But if a module developer wanted to display hookA in zone X, they could do that; and then display all other hooks except hook A in Zone Y.
  • Maybe this will help you.

    --
    "He is not dangerous, he just wants to play...."
  • Thanks, yes, knowing this is coming is very helpful. I do need it for Pagesetter, so I guess I need to wait for that to handle it as well.

    For the moment I've discovered that I can manipulate the display of a particular hook in it's template, but enclosing it in a div element and positioning it in a particular place on the page. I leave room for it in the Pagesetter doc template. Not a real elegant zone-based PN/Xanthia method, but it does work.
  • 0 users

This list is based on users active over the last 60 minutes.