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

Dizkus

Bottom
Merging two or more blocks
  • Posted: 20.01.2004, 22:39
     
    PlanetDeusEx.ru
    rank:
    Registered User Registered User
    registered:
     January 2004
    Status:
    offline
    last visit:
    23.01.04
    Posts:
    1
    Hi everyone,
    i have a question related to blocks: is it possible to merge two or more block contents in one? CS Center Block isn't a good decision because it merges as contents so as designs of that blocks.
    For example, i want to see past articles and past downloads contents in one main block. How to do this?
    I asked this question on many forums but i still don't have an exact answer.
  • Posted: 20.01.2004, 23:43
     
    nate_02631
    rank:
    Professional Professional
    registered:
     September 2003
    Status:
    offline
    last visit:
    11.04.08
    Posts:
    3055
    You could create a new PHP block with the code to display the blocks manually:

    Code

    // Get info & output the story block
    $block = pnBlockGetInfo(1);
    echo pnBlockShow('Core', 'story', $block);

    // Get info & output the downloads block
    $block = pnBlockGetInfo(2);
    echo pnBlockShow('Core', 'download', $block);

    NOTE: Replace the # in the pnBlockGetInfo's with the block's bid (see the links in Admin->Blocks)... Also, replace the "story" & "download" with the value under "name" in the same menu, and take notice of the "module" that blocks uses (both of these I happen to know are "Core").

    This method will output the blocks in the style of whatever zone they are set up with in the Blocks Admin, but you can override by placing a

    Code

    $block['position'] = 'x';

    before the blockshow line of each block being outputted. In your theme, in the themesidebox() function, just make sure you have a corresponding position check & HTML for the zone in question -- you aren't even restricted to using "l", "r", & "c"; you can make you own custom output in your theme just for these "combined" blocks.

    You can also mix regular HTML output with the above code too!

    --
    Get PhotoGallery, PayPalCart, Dynamenu, Enhanced Blocks & other mods

    Cape Cod Travel Info...
  • Posted: 07.03.2004, 08:09
     
    Shelby
    rank:
    Helper Helper
    registered:
     February 2004
    Status:
    offline
    last visit:
    16.06.06
    Posts:
    108
    Assume I'm 12 years old. Paint me a picture. Heh.

    No really though, okay assuming I want to make a new PHP block with the code to display the blocks manually, I'm not sure how I would go about calling out the blocks. Where exactly would I use the code you provided?
  • Posted: 07.03.2004, 08:10
     
    Shelby
    rank:
    Helper Helper
    registered:
     February 2004
    Status:
    offline
    last visit:
    16.06.06
    Posts:
    108
    .
  • Posted: 07.03.2004, 08:27
     
    nate_02631
    rank:
    Professional Professional
    registered:
     September 2003
    Status:
    offline
    last visit:
    11.04.08
    Posts:
    3055

    nate_02631

    You could create a new PHP block with the code to display the blocks manually

    Again, being careful to change the "Core" value to the name of the parent module of the block you are calling...

    --
    Get PhotoGallery, PayPalCart, Dynamenu, Enhanced Blocks & other mods

    Cape Cod Travel Info...
  • Posted: 29.03.2005, 03:00
     
    shawngiese
    rank:
    Softmore Softmore
    registered:
     July 2002
    Status:
    offline
    last visit:
    27.10.06
    Posts:
    65
    Thanks Nate, you are the king of blocks. This worked great!

Extensions Moderation

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula