Need help with page blocks

Hi,

There are a lot of pages which arent listed on the page blocks admin feature. I was wondering if there was a way to add these pages? Otherwise, how would I go about editing them? e.g I was to remove some options from things like adding an event or adding a store product.

Thanks :)

Quote · 22 Feb 2010

i have got the same problem,

how can we add same page block to different pages ???

Quote · 1 Mar 2010

Anyone?

Quote · 2 Mar 2010

There is only one way to do it and that is to manually edit the database table sys_page_compose making a copy of the block you want on another page and changing the field value of Page to the name of the page you want it to appear on.

Then going to the page builders and move it's location to where you want it. It will have to be moved anyway to force dolphin to rebuild the page cache even if it is in the right spot from the start.

But be aware that not all blocks will work on every page. So simply sticking the block on another page won't always work. If it don't then far more extensive changes will need to be done by a developer.

I know it sounds like something that should be easy to do. But in most cases it will not be that simple.

https://www.deanbassett.com
Quote · 2 Mar 2010

Is there an easier way to do this ?

this sounds too risky and complicated...!!!

Quote · 3 Mar 2010

Is there an easier way to do this ?

This IS the easier way.

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 3 Mar 2010

There is only one way to do it and that is to manually edit the database table sys_page_compose making a copy of the block you want on another page and changing the field value of Page to the name of the page you want it to appear on.

Then going to the page builders and move it's location to where you want it. It will have to be moved anyway to force dolphin to rebuild the page cache even if it is in the right spot from the start.

But be aware that not all blocks will work on every page. So simply sticking the block on another page won't always work. If it don't then far more extensive changes will need to be done by a developer.

I know it sounds like something that should be easy to do. But in most cases it will not be that simple.

Does anyone have an example on how to do these more extensive changes, cause I have tried a few ways, with no luck :(

One I created a new page block in the DB, for the member.php page and gave it function name.

In member.php I created at function where I pasted in the following bit of code, in the hope that I could get "featured photos" to show!?

----

function getBlockCode_memPhotosSpecial () {

require_once(BX_DIRECTORY_PATH_MODULES . 'boonex/photos/classes/BxPhotosPageHome.php');

// dosnt work correct

$oMedia = new BxPhotosSearch();

$aVisible[] = BX_DOL_PG_ALL;

if ($this->iMemberID > 0)

$aVisible[] = BX_DOL_PG_MEMBERS;

$aCode = $oMedia->getBrowseBlock(array('allow_view'=>$aVisible, 'featured'=>1), array('menu_top'=>true, 'per_page'=>(int)getParam('number_top')));

return array($aCode['code'], $aCode['menu_top'], $aCode['menu_bottom'], $aCode['wrapper']);

}

Can anyone point me in the right direktion here? Thankz:)

Quote · 6 Apr 2010

what is the process to duplicate a field in myphpadmin ?

Quote · 8 Apr 2010

 

 

There is only one way to do it and that is to manually edit the database table sys_page_compose making a copy of the block you want on another page and changing the field value of Page to the name of the page you want it to appear on.

Then going to the page builders and move it's location to where you want it. It will have to be moved anyway to force dolphin to rebuild the page cache even if it is in the right spot from the start.

But be aware that not all blocks will work on every page. So simply sticking the block on another page won't always work. If it don't then far more extensive changes will need to be done by a developer.

I know it sounds like something that should be easy to do. But in most cases it will not be that simple.

 

Does anyone have an example on how to do these more extensive changes, cause I have tried a few ways, with no luck :(

One I created a new page block in the DB, for the member.php page and gave it function name.

In member.php I created at function where I pasted in the following bit of code, in the hope that I could get "featured photos" to show!?

 

----

function getBlockCode_memPhotosSpecial () {

require_once(BX_DIRECTORY_PATH_MODULES . 'boonex/photos/classes/BxPhotosPageHome.php');

// dosnt work correct

$oMedia = new BxPhotosSearch();

$aVisible[] = BX_DOL_PG_ALL;

if ($this->iMemberID > 0)

$aVisible[] = BX_DOL_PG_MEMBERS;

$aCode = $oMedia->getBrowseBlock(array('allow_view'=>$aVisible, 'featured'=>1), array('menu_top'=>true, 'per_page'=>(int)getParam('number_top')));

return array($aCode['code'], $aCode['menu_top'], $aCode['menu_bottom'], $aCode['wrapper']);

}

 

Can anyone point me in the right direktion here? Thankz:)

 Never mind we finaly solved it but now we face a new problem and here it is:

Could someone maybe give us a pointer on how to place a php code(fore generating a link) in the header section of a template, not using the standart top menu or content blocks?
And one last thing, do you have a good link to a post or other that describse how the placeholder( __something__ ) system works, as you cant put php directly in to the html pages?


Quote · 19 Apr 2010


And one last thing, do you have a good link to a post or other that describse how the placeholder( __something__ ) system works, as you can't put php directly in to the html pages?

Not easy to describe, and there are no docs on this. But i will try to explain it.

The __something__ are replaced by the script at the time the template is parsed prior to rendering it. They are specific to the template and script using that template and not available globally. So to add more you would need to find out which script is using what template.

For most of the modules that is fairly easy.

Lets look at the quotes module as it is the easy one. It has a template that looks like this.

<div class="quote_div">
<div class="daily_quotes">
<i>&quot;__unit_text__&quot;</i><br />
<p class="author">__author__</p>
</div>
<div class="clear_both"></div>
</div>

There are 2 replacement keys there. __unit_text__ and __author__

In the script in the classes BxQuotesModule.php is a function that uses this template and does the processing of those values.

function serviceGetQuoteUnit() {
$oQuoteUnit = $this->_oDb->getRandomQuote();

$sUnitText = process_text_output($oQuoteUnit['Text']);
$sUnitAuthor = process_line_output($oQuoteUnit['Author']);

$aVariables = array (
'unit_text' => $sUnitText,
'author' => $sUnitAuthor
);

$sCss = $this->_oTemplate->addCss('unit.css', true);
return $sCss . $this->_oTemplate->parseHtmlByTemplateName('unit', $aVariables);
}


The function here parseHtmlByTemplateName is the template parser function. Passed to it is the name of the template and an array of items to be replaced. The array is populated just above that.

$aVariables = array (
'unit_text' => $sUnitText,
'author' => $sUnitAuthor
);


In the template, unit_text is listed as __unit_text__  They start and end with 2 underscores, but are not used when the array is actually populated.

Functions like parseHtmlByTemplateName will be found in most functions where a template is used and the procedure is much the same. There are other functions similar to parseHtmlByTemplateName that do similar things, but slightly different is how it handles the template. I also do not have a complete list of these.

Best thing to do is study the classes for the modules such as this one or the sample module boonex provides so you can learn how to recognize these areas when you see them. A sample module is located here.

http://www.boonex.com/trac/dolphin/wiki/DolphinTutorialMyFirstModule

You should also check out other developer info here.

http://www.boonex.com/unity/forums/#topic/Developers-Links.htm

https://www.deanbassett.com
Quote · 19 Apr 2010
 
 
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.