Topic: Merging two or more blocks
PlanetDeusEx.ru
avatar
Registered User
Registered User
Posts: 1

Posted:
20.Jan 2004 - 22:39

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.
nate_02631
avatar
Professional
Professional
Posts: 3055

Posted:
20.Jan 2004 - 23:43

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...
Shelby
avatar
Helper
Helper
Posts: 108

Posted:
7.Mar 2004 - 08:09

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?
Shelby
avatar
Helper
Helper
Posts: 108

Posted:
7.Mar 2004 - 08:10

.
nate_02631
avatar
Professional
Professional
Posts: 3055

Posted:
7.Mar 2004 - 08:27

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...
shawngiese
avatar
Softmore
Softmore
Posts: 65

Posted:
29.Mar 2005 - 03:00

Thanks Nate, you are the king of blocks. This worked great!