Exactly where does a menu block get loaded from the DB?  Bottom

Go to page 1 - 2 [+1]:

  • Just Exactly where in Zikula 1.1.1 does a menu block get loaded from the DB? I see a triad relationship between pnTheme.class=>pnRender.class & finally the Smarty.class's fetch function is called, but from there I can't find the actual database query for getting the menu block from the *_blocks table. It's all obscured or hidden because of all that caching stuff. So, my question is simple:

    1) I would appreciate a source file + line number showing me EXACTLY where the DB query for getting a menu block row is.

    Thanks.
  • What are you trying to accomplish? It may be possible with out that info. Not trying to hid the info, just want to make sure you do what you need the best way, since modifying core code isn't recommended.

    --
    Home Page | Find on Facebook | Follow on Twitter
  • On my PN 7.6.4, I added a way to dynamically show a selective menu core block depending upon the "context" of the page(s) on my website. Since migrating to Zikula last week, I find that Zikula still doesn't have the ability to display only one of many selected core menu blocks (It just displays them all).

    I'm thinking about submitting this as a core contribution when I get it going on Zikula - I just need to know EXACTLY where the DB query for getting a menu block row is. Thanks.
  • You can define which pages a block shows on in the Advanced placement options.

    --
    Home Page | Find on Facebook | Follow on Twitter
  • a) Advanced search in all forums for "Advanced placement" yields NO results
    b) Search in Blocks Admin docs (@ http://community.zikula.org/index.php?module=Wiki&tag=BlocksAdmin) yields NO mention of "advanced" AND/OR "placement"
    c) Search in doc index (@ http://community.zikula.org/index.php?module=Wiki&tag=PageIndex) yields NO mention of "advanced" AND/OR "placement"
    d) Search on the blocks module admin interface pages for any mention of "advanced" AND/OR "placement" anywhere reveals NOTHING related to this at all
    e) One hour more of wasted & fruitless searching (including Google)...

    Look, you got it backwards anyways. I want a specific menu block displayed for a particular page, so the PAGE is the main controller here. If you need to know why, it's for usability sake.

    Now that it's quite clear Zikula core functionality doesn't have want I need , I will try one last time to ask the same question:

    1) I would appreciate a source file + line number showing me EXACTLY where the DB query for getting a menu block row is.

    If you succeed in answering my initial question, then I'll go through submitting this to the core. Thank U.
  • My answer to my question appears to be in ./includes/pnBlocks.php - there's a few DBUtil type accesses of which one appears to be a strong candidate. It looks like all *_blocks columnar info is stuffed in the result set array. That means that wht I'm really after, which is $blockinfo['URL'] might just be present when ./system/pnRender/plugins/function.pnblock.php's smarty_function_pnblock renders a block.

    That is, unless you can incontrovertibly tell me that "Advanced placement" can do what I need to do and you or some undiscovered documentation tells me how to use it. Thanks.
  • Did you even look at the options in your installation? If you go to admin-layout-blocks and edit one of the blocks, you'll see

    Quote

    Click to show/hide advanced block placement options

    When you click on that you're presented with options for modules to display the block in, and you can define the function type, function and custom arguments, just like the start page in the Settings. Just because it's not in the documentation doesn't mean what you want isn't there. It means it's not documented.

    In the future, consider the experience of the person telling you something, because it just may be that that person knows stuff that's missing from the docs.

    Now if that's not enough info for you, what's the URL you want this block to appear on? If you don't want to make it public, PM it to me and I'll tell you exactly what to fill out in that part of teh settings for the block in question.



    edited by: HalbrookTech, Apr 06, 2009 - 09:15 PM

    --
    Home Page | Find on Facebook | Follow on Twitter
  • OK - it's 3 hours and counting. Attempts to find "admin-layout-blocks" totally fruitless. I don't know where "admin-layout-blocks" is or how to get to it. I've been just about everywhere in the admin UI - I've got severe eyestrain. Suggest just giving me a straight-up URL, like "http://localhost/index.php?module=Administration&type=admin&func=modifyconfig" instead of some shorthand like "admin-layout-blocks". I know exactly what admin template page I need to get to (./systemBlocks/pntemplates/blocks_admin_modify.htm) but I can't for the life of me get Zikula to produce this page.

    I tried going directly to http://localhost/index.php?module=Blocks&type=admin&func=modify, which should bring up the blocks_admin_modify.htm template page that has the magical advanced block placement choices, but I get a 'page not found' error page (even though an equivalent URL works just fine for the modifyconfig function, which neatly brings up the blocks_admin_modifyconfig.htm template, which is useless for anything except for collapsible menus).

    A little (less cryptic) help, please.
  • Hey - I answered my own question again by digging further. Halbrook Tech's "admin-layout-blocks" shorthand is actually admin->System->Blocks, then click on the edit icon for a chosen block. If this is undocumented, you cannot just specify some undocumented, misleading shorthand and expect your audience to 'get it'. The actual URL is http://localhost/index.php?module=Blocks&type=admin&func=modify&bid=1, so I was very close to finding it the last time. It's on this page that you can click on the "Click to show/hide advanced block placement options" link to enable various "advanced" options.

    However (as in BUT, all uppercase), this block-per-module functionality is NOT what I need, as I had posted previously. I could not have said it any clearer:

    Quote


    I want a specific menu block displayed for a particular page, so the PAGE is the main controller here.

    Halbrook's assertion that

    Quote

    You can define which pages a block shows on in the Advanced placement options.
    is not correct. A more accurate description is

    Quote

    You can define which MODULES a block shows up on in the Advanced placement options.


    This is an important point, since I assumed that "Legend" Halbrook was volunteering accurate information about the advanced placement feature. I believed him/her and ended up on a few days worth of goose chasing.

    BTW - My core change in pnTheme.class.php works just fine, thank you (total time spent there = 4 hours).
  • lhale

    OK - it's 3 hours and counting. Attempts to find "admin-layout-blocks" totally fruitless. I don't know where "admin-layout-blocks" is or how to get to it.

    Sorry, you were planning to mess around in code to create a patch, I assumed you'd realise that was a path to follow to get where you needed to get. Go to index.php?module=Blocks&type=admin&func=view

    From there, click the pen icon on the line of the block you want to do this with.
    You'll see the link I mentioned there, when you click it, it will expand out the settings. From there, it's just like the Start Page Settings in the Settings area. Pick the module, and add whatever other details are needed to get it to the specific page you want. As I said before, if you can't figure out what to put in there, post the index.php... line from the URL you want this to happen on and I'll give you the code to put in there.

    Quote

    I've been just about everywhere in the admin UI
    Execpt the obvious place, the Blocks admin from the layout tab.

    Quote

    but I can't for the life of me get Zikula to produce this page. I tried going directly to http://localhost/index.php?module=Blocks&type=admin&func=modify

    It's rarely that easy as in this case the system needs to know which block ID you want to work with.

    --
    Home Page | Find on Facebook | Follow on Twitter
  • By "admin-layout-blocks", he means go to the Admin Panel, click on the Layout category in the tab menu (3rd Party / Content / Hooked / Layout / Security / System / Users) and then click on the Blocks icon you will then see.

    A page then displays showing, at the top, a table listing blocks that are currently active and, at the bottom, a table listing the block positions currently defined for your site.

    If you need to, you can define additional block positions. For instance, if you want a block to display at the top of the page, you can click on "Create block position" in the options at the top of that page, enter "top" for the name and (for instance) "Top blocks" as the description.

    That gives you a new block position.

    You can also edit blocks. For that, still in the Blocks section of the Admin Panel, you look in the list, and you click on the red pen icon on the right. That takes you to a page where you can do "advanced block configuration" in the Update Block page. In that page, you have a link entitled "Click to show/hide advanced block placement options".

    Click on that link and you get a listing of all the modules currently installed for your Zikula site, and you can pick and choose the modules in which that block displays. For that, you put a checkmark beside the modules where it should display, and leave the others unchecked. This is what Michael was talking about in his post above.

    Then, the next feature of Zikula you would use is the ability to create your own custom templates to replace those standardly supplied by Zikula, for any module and any page that a module displays. (You could also edit the standard templates, but that's an unclean, hacky way to do it, because your personalized template would get overwritten if you upgrade your site to a new version of Zikula).

    Basically, by using a combination of custom page templates, block positions and block display settings, you should certainly be able to achieve what you want without having to start hacking the actual Zikula code. That's what they mean when they talk about "separating presentation from application logic". It's almost certainly unnecessary for you to have to start re-writing the actual code of Zikula to do what you want.

    I know it can be frustrating at first when you're on the learning curve. There is documentation in the Wiki covering these particular subjects. The Wiki documentation isn't perfect by any means at this time (we're working on it), but what you need is there.

    Take a look at:

    http://community.zi…tag=TemplateEditing
    http://community.zi…iki&tag=BlocksAdmin
    http://community.zi…&tag=TemplatesIntro
    http://community.zi…g=TemplateOverridng

    That should get you started. And feel free to post back here if there's something not clear.

    But you also need to give us clear and explicit explanations about what you want to achieve, possibly with a URL or two, so that we can clearly understand what you want. Because, me, I didn't. icon_wink

    We, the people in the project and the community, love to help people out, but we're just guys, you know? icon_smile And nobody pays us for this. And many of us are not coders either. icon_smile

    Anyway, have a read and post back if we can help out more.

    --
    David
    http://zikula.tv
  • Halbrook & Zikuloatv:

    I don't have half the tab menus you're talking about, especially the 'Layout' one, which is the root of all confusion (and waste of time). My tab selections are as follows:

    3rd Party / Content / Resource Pack / System Utility

    That's it. No Hooked, no Layout, no Security, no Users.
    If you've ideas on how I can enable them in, let me know. Last week's PN 7.6.4=>Zikula 1.1.1 upgrade is probably the culprit. Otherwise, I can get to all of these through other admin UI links.

    BTW - I was able to configure the blocks to show up based on my URLs via the advanced block placement stuff. Unfortunately, since the "advanced placement" capability is module based, I'm stuck on how one configures certain blocks for the welcome page - I want at least one to show up there. The welcome page doesn't have a specific module affinity.
  • Ah, that explains part of the confusion. My attempt at a bread crumb earlier might have made more sense to you. It's not really nessecary to reorganize your tabs, unless you really want to. That is totally cosmetic. The best way to do it if you want is to look at the demo site (demo.zikula.org) and see what's in everything except 3rd Party.

    As to the welcome page. What I would do, personally, is create a custom block position for that particular block and add the code for it in the template for the home page.

    --
    Home Page | Find on Facebook | Follow on Twitter
  • Quote

    Halbrook's assertion is not correct. A more accurate description is "You can define which MODULES a block shows up on in the Advanced placement options"


    No, in fact he's right, because you can choose not only the module but you can also specify the function and parameters used in that module, which equates to being able to specify right down to a particular page. icon_wink

    --
    David
    http://zikula.tv
  • Halbrook:
    Well it explains MOST of the confusion. I was reverse engineering how to get to the elusive advanced placement stuff, not knowing if it was a whole seperate configuration page or a per-block thing. Sure makes it difficult when you're missing key tabs. Which reminds - how do I get the missing tabs configured in?

    Zikulatv:
    I assert that my description is more accurate than Halbrook's and this is why:
    Using the function/parameters capability of the advanced placement stuff, you cannot assign a many-to-one affinity of multiple pages to a specific menu block. For instance, I want to show a particular Core menu block in the following situations:
    1) http://localhost/index.php?module=htmlpages&func=display&pid=5
    2) http://localhost/index.php?module=htmlpages&func=display&pid=6

    Now, using the module(s)/function/parameters capability of the advanced placement stuff, how would you do this? Unless these fields validate Regex strings or equivalent, I'm screwed. Like mentioned before, there are valid usability reasons why I need this capability (and I trounce both of you in the areas of HCI, cognitive psychology and IA experience).

Go to page 1 - 2 [+1]:

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