New Module, Divide page into different sections ?

Well forgive me for asking such a newb question (if it is?) but can any one tell me how to have different section of the

home page of my new module ? I mean different (Boxes?) ..


For example in the "Groups" module's homepage, there is a "Featured Group" section/box and on left side there is "New Groups"

section/box .. So If I am writing a new module, how can I create that ?

 

I have following in MeBlggModule.php file .. but it creates only single box when pageCode is called .. :S   .

function actionHome () {
$this->_oTemplate->pageStart();
$aVars = array (
'server_time' => date('r'),
);
echo $this->_oTemplate->parseHtmlByName('main', $aVars);
$this->_oTemplate->pageCode(_t('_me_blgg'), true);
}
Quote · 26 Sep 2010

Basically you need to define the pages and blocks in your install.sql e.g.

 

The sql below defines the page for the groups view:

SET @iMaxOrder = (SELECT `Order` FROM `sys_page_compose_pages` ORDER BY `Order` DESC LIMIT 1);

INSERT INTO `sys_page_compose_pages` (`Name`, `Title`, `Order`) VALUES ('bx_groups_view', 'Groups View', @iMaxOrder+1);

 

Then basically you add blocks to the page. The sql below add's 2 blocks, 1 (Actions) block on the left (see column value '1' with colwidth '34') and 2nd block (see column value '2' with colwidth '64') to the groups view page.

INSERT INTO `sys_page_compose` (`Page`, `PageWidth`, `Desc`, `Caption`, `Column`, `Order`, `Func`, `Content`, `DesignBox`, `ColWidth`, `Visible`, `MinWidth`) VALUES

('bx_groups_view', '998px', 'groups's actions block', '_bx_groups_block_actions', '1', '0', 'Actions', '', '1', '34', 'non,memb', '0'),

('bx_groups_view', '998px', 'groups's description block', '_bx_groups_block_desc', '2', '0', 'Desc', '', '1', '66', 'non,memb', '0'));

 

Then you define code like you mentioned which will display contents within these blocks.

 

HTH

Armaan

 

Note: Make sure you see uninstall.sql as well because you will have to delete the stuff you added.

Facebook, Twitter & Instagram Combo - http://bit.ly/1h5CarP
Quote · 26 Sep 2010

Thanks for your answer .. : )

 

Okay so suppose I have that sql inserted into database.. How would I write the code to show these different

page blocks on the main page ?? :S

 

When I add another

echo $this->_oTemplate->parseHtmlByName('main', $aVars);

in actionHome() in MeBlggModule.php then I only get the message in that same single block but repeated .. :(

 

please help

Quote · 15 Oct 2010

Did you find an answer to this question?

Quote · 10 May 2011
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.