Fork me on GitHub

Block placement filtering feature  Bottom

  • In Admin Panel we have the opportunity to hide/show a block for specific modules. The admin link is :
    "index.php?module=Blocs&type=admin&func=modify&bid=xxx"

    There, you will find the "Block placement filtering" section.

    Click on the "Click to show/hide advanced block placement options" link to show the list of modules where you want the block to be saw.

    ....quite simple ! but more diffucult when we want to show the block only for a specific function of a module.

    Is someone able to show me an example about what kind of datas we have to put in these 3 fields :
    [*]Function type(s)
    [*]Function
    [*]Custom Arguments

    i have try many possibilities but nothing works (for ex):
    [*]Function type(s) = user or admin ...
    [*]Function = func or file or type ...
    [*]Custom Arguments = archives or view ...

    Thanks to tell me how to configure this feature with an example or is this feature buggy ? (don't work yet ?)


    --
    keep an eye Open
  • It depends on which module your wish to show. An example using the content module would be:

    [*]Function type(s) = user
    [*]Function = view
    [*]Custom Arguments = pid=1


    --
    David
  • Seems that you're putting the values in the wrong place:

    [*]Function type(s) = user or admin ... OK
    but you might not use admin type in the homepage or yes? icon_razz

    [*]Function = func or file or type ... ??
    file is an old parameter, this feature is for pnAPI compliant modules
    and Function is the func parameter

    [*]Custom Arguments = archives or view ...
    archives or view? this seems the function name
    and as Davis said, here you put the parameters:
    param1=value1,param2=value2

    --
    - Mateo T. -
    Mis principios... son mis fines
  • DavidJ

    It depends on which module your wish to show. An example using the content module would be:

    [*]Function type(s) = user
    [*]Function = view
    [*]Custom Arguments = pid=1


    I haven't been able to get this working either. I have an RSS feed center block which I'd like to display only on a particular page made with the Pages module.

    I've checked "Pages" in the checkbox under the "The following options allow the display of the block to be restricted to certain modules and module functions"

    Then what I've tried is:
    Function type(s) = user
    Function = display
    Custom Arguments = pageid=2 (the particular page from Pages I'd like it to display on)

    For the life of me I can't see why it doesn't work. Any help would be appreciated.

    Thanks!
  • Pages checked

    Function type(s) = user (optional)
    Function = display
    Custom Arguments = pageid=2

    Temporary proof:
    http://dpahl.com/index.php?module=Pages&func=display&pageid=2
    http://dpahl.com/index.php?module=Pages&func=display&pageid=1

    --
    David Pahl
    Zikula Support Team
  • Thanks, David...so from what you're showing me, it appears I've done it correctly but it's not displaying for me. I can't figure out what I'm doing wrong :(

    It's a fresh Zikula install, 1.0.1 with the basic modules installed.

    I had the same problem on another recent install of 1.0.0 and would love to figure this out. It seems so straight forward but I can't see what is causing the problem.
  • I am running zk 1.0.2 (unreleased), here. I will check the fixes, but I didn't recall a block filter error. Not sure off hand what would thwart a filter.

    --
    David Pahl
    Zikula Support Team
  • Thank you all for your help to understand how this feature works. Sorry for the delay to answer but i was away. In fact this feature works well for a module but i got an other interesting question. You are able to select multiple module where to show the block, but the filter do not ditinguish for what module it should apply. Thus the block doesn't show for every modules they don't have this specific function or argument. So we have to create the same block multiple time for the other modules. Am i right ?
    It should be great to have an extra field to indicate for what module the function is. every function for the same module separate with coma "," and a ";" for the next module like this:

    [*]Modules = News; Topics; Reviews;
    [*]Function type(s) = user; user; user;
    [*]Function = view, display; (no func filter for Topics) ; show;
    [*]Custom Arguments = pid=1; sid=2; (no custom arguments for Reviews);

    What do you think about that ? icon_wink
  • Neat. How did "Unregistered" manage to post?

    --
    Help Now! Fast and affordable help for do-it-yourself webmasters from Wicked Viral :: Chicago's Only Web Development Firm Specializing in Social Networking Integration
  • @dreamingmonkey:
    Hehehe, his session expired until he wrote that post,
    happened to me a couple of times...

    @keops:
    Indeed a nice idea, currently there's a strange piece of code in the pnBlocks:

    Code

    if (!empty($blockinfo['filter']['modules']) && !in_array($modname, $blockinfo['filter']['modules'])) continue;


    Seems that filer.modules should be an array, but how?
    i guess that you propose a cool format, have to build a patch to get this in 1.1
    and see if that line is a buggy one in the current SVN...

    --
    - Mateo T. -
    Mis principios... son mis fines
  • Bringing this back to the top...

    Is it possible to have multiple arguments in the advanced placement options? I want to only show a block when viewing a certain PageMaster tid and pid, e.g. http://govargo.com/index.php?module=section&func=viewpub&tid=1&pid=4

    I put pid=4 in the function arguments field and it works great. But if I visit another PageMaster tid that also has a pid=4, then, of course, the block shows there also, and I don't want it to. So I tried adding the argument tid=1 to the function arguments. I tried separating the two arguments with a comma, semicolon, ampersand and space but none of them have the expected results. In fact, when using the comma, it shows the block twice when both arguments are met.

    How can I get this working? Thanks! icon_smile

    Zikula 1.2.4, PageMaster 0.4.2

    --
    Harness Technology
  • 0 users

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