Zikula: A Flexible Open Source Content Management System
home | forum | contact us

Dizkus

Bottom
MultiHook setup incomplete?
  • Posted: 05.07.2007, 01:56
     
    alarconcepts
    rank:
    Professional Professional
    registered:
     April 2004
    Status:
    offline
    last visit:
    21.01.08
    Posts:
    2723
    I installed MultiHook, the Ajax lib, activated the module, configured the module, assigned it to work with another (custom) module, added the hooks call to the template, refreshed the page. Nothing was changed in the text of the module output at all.
    At the very end of the user display template, I have the following 2 calls:

    Code

    <!--[pnmodurl modname=ModNameHere func=display id=$project.id assign=returnurl]-->
    <!--[pnmodcallhooks hookobject=item hookaction=display hookid=$project.id module=ModNameHere returnurl=$returnurl]-->

    , which does bring attach EZComments to the (custom) module.

    Did I miss some step for integrating MultiHook functionality?

    Thank,

    - John



    edited by: alarconcepts, Jul 04, 2007 - 03:57 PM

    --
    Photography | PHP | Other
  • Posted: 05.07.2007, 05:38
     
    alarconcepts
    rank:
    Professional Professional
    registered:
     April 2004
    Status:
    offline
    last visit:
    21.01.08
    Posts:
    2723
    I did get the MultiHook functionality to work with the custom mod by using

    Code

    <!--[$someTextToDisplay|pnmodcallhooks]-->



    ...but since there are several variables on the page that require the (display and transform) hooks, that leads to using the modifier over and over again in the template. I thought there's a way to call all hooks for the whole page in one call, isn't there? The way I did it here feels bloated.


    I notice that the edit-links seem to do nothing and I believe this has something to do with Ajax, but not sure what to do about it. Hovering the edit-links does give me title-text if that's of any consequence. I installed the Ajax support package at first, but then reverted back, since I'm doing this on an MS3 installation which already contains the support by the looks of it.


    Can anyone shed some light on a better way to call these hooks and on how to get the edit-links to work?


    Thanks,


    - John



    edited by: alarconcepts, Jul 04, 2007 - 07:39 PM

    --
    Photography | PHP | Other
  • Posted: 05.07.2007, 16:14
     
    rank:
    Moderator Moderator
    registered:
     March 2002
    Status:
    offline
    last visit:
    26.08.08
    Posts:
    7720
    John,

    The way that you've solved it is the current methodology. Hooks are called in the templates on a a variablle by variable basis. As you've seen this does lead to some extra processing however gives the flexibility to support hooks for specific module output. An example of where this is useful is the nofollow hook. nofollow is useful in user submitted content, for example comments, but not in your own content. So in this case it wouldn't be ideal to process the entire page for this hook.

    There has been some discussion in the past about hooks becoming Smarty plugins - implemented as output filters. You could then choose to either use this on a specific template variable or on the whole page (by adding the modifier to the themes 'maincotnent' variable).

    However moving hooks to plugins adds an extra level of skill to the requirements for most site admins since you'd lose the ability to control this via the admin panel. Something to consider for the future anyway.

    -Mark
  • Posted: 05.07.2007, 18:50
     
    alarconcepts
    rank:
    Professional Professional
    registered:
     April 2004
    Status:
    offline
    last visit:
    21.01.08
    Posts:
    2723
    Mark,

    Many thanks for the details on this. I see the dilemma you mention and don't mind doing it this way, so long as it's the accepted method.

    About the edit-links that seemed to not work, I tried a handful of ways in my MS3 install to no avail. I used a June 4 copy of the core from SVN and MultiHook 4.5 (w/ and w/o Ajax support package, but that didn't work out. So, I kept the core I had and tried MultiHook 5, and finally updated my core to yesterday's copy (still on MH 5) ... but was getting a fatal (PHP) error related to adding a pagevar. Should one of these setups have worked, do you think? I must admit, I was practically falling asleep before I gave up, so perhaps I foolishly overlooked something simple.

    I read somewhere about the Ajax(?) support causing the page to scroll forever. I actually saw this on Simon's site a day or so ago, but it seems to be gone now. Is this something to look out for?

    Thanks,

    - John

    --
    Photography | PHP | Other
  • Posted: 05.07.2007, 19:11
     
    alarconcepts
    rank:
    Professional Professional
    registered:
     April 2004
    Status:
    offline
    last visit:
    21.01.08
    Posts:
    2723
    One more bit of info ... all of these attempts were done with ExtraLite (my preferred development layout), but this morning I also (via URL anyway) tried this with andreas08, SeaBreeze and voodoodolly, so, I was thinking it probably wasn't a theme-based issue.

    --
    Photography | PHP | Other
  • Posted: 06.07.2007, 07:47
     
    videokid
    rank:
    Professional Professional
    registered:
     March 2003
    Status:
    offline
    last visit:
    19.11.08
    Posts:
    901
    Interesting.. since I was working on my first PostNuke site... I was wondering if you could call a hook by name, or string...

    e.g.

    Code

    <!--[if $pnmodcallhooks == "Ratings"]-->
    <!--[$someTextToDisplay|pnmodcallhooks assign=Ratings]-->
    <!--[$Ratings]-->
    <!--[/if]-->


    Not really right of course... but the point is: that way you could place the actual hook where the site admin/developper wants it... And yes, I've searched this forum, but now actual answer came up...

    - Igor

    --
    Have a nice day
    zikulapro.be is currently running
    Zikula 1.0.2
  • Posted: 06.07.2007, 08:01
     
    AmmoDump
    rank:
    Professional Professional
    registered:
     December 2003
    Status:
    offline
    last visit:
    21.11.08
    Posts:
    2975
    Reference Note:

    Steffen has a nice cheatsheet:

    http://www.kaffeeringe.de/module-article-viewpub-tid-9-pid-278.html

    --
    David Pahl
    Zikula Support Team
  • Posted: 06.07.2007, 08:09
     
    videokid
    rank:
    Professional Professional
    registered:
     March 2003
    Status:
    offline
    last visit:
    19.11.08
    Posts:
    901
    mmm I have that sheed...
    Now I feel pretty dumb!

    Thank you for refering it again!!

    - Igor

    --
    Have a nice day
    zikulapro.be is currently running
    Zikula 1.0.2
  • Posted: 06.07.2007, 15:38
     
    alarconcepts
    rank:
    Professional Professional
    registered:
     April 2004
    Status:
    offline
    last visit:
    21.01.08
    Posts:
    2723
    Here's also a link to some other interesting hooks examples showing how to separate hooked content for display purposes.

    --
    Photography | PHP | Other
  • Posted: 07.07.2007, 15:21
     
    videokid
    rank:
    Professional Professional
    registered:
     March 2003
    Status:
    offline
    last visit:
    19.11.08
    Posts:
    901
    In my case, alarconcepts give me the initial set-up...
    For a Pagesetter template, it resulted in...


    Code

    <!--[pnmodurl modname=pagesetter func=viewpub tid=$core.tid pid=$core.pid assign=viewUrl]-->
    <!--[pnmodcallhooks hookobject=item hookaction=display hookid=$core.uniqueId module=pagesetter returnurl=$viewUrl implode=false]-->




    <div class="ratings"><!--[$hooks.Ratings]--></div>
    <div id="comments"><!--[$hooks.EZForumComments]--></div>


    very cool... so, in performance it should'n matter??

    - Igor

    --
    Have a nice day
    zikulapro.be is currently running
    Zikula 1.0.2
  • Posted: 07.07.2007, 18:18
     
    alarconcepts
    rank:
    Professional Professional
    registered:
     April 2004
    Status:
    offline
    last visit:
    21.01.08
    Posts:
    2723
    David, thanks for pointing out that cheat sheet, very handy. :)

    Igor, any performance issues would be extremely minimal, I believe, since the hooks are only called once and then separated, as opposed to being called individually and then assembled from there.

    --
    Photography | PHP | Other

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula