Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


Why do you need layout for your extension?
Most of extensions of features add to AbanteCart will require display of information. This information might need to be shown in particular part of the page. This can be controlled with using a block to show information. This block can be set to needed part of the page with setting it in layout manager. The steps are the following: Add new block to layout manger, Add new block to layout. If layout is not known, user needs to be informed of the block and directed to layout manager in control panel to enable this block there it is desired.

Layout and blocks can be loaded with one XML files that will create all the database entries for the layout and block. There is a function loadXML() that is available in ALayoutManager class. This function can be called or if you

Code Block
$layout = new ALayoutManager();
// Input possible with XML string, File or both.
// We process both one at a time. XML string processed first
$layout->loadXml(array('file' => $file));
$layout->loadXml(array('xml' => ‘xml string here’));

'file' => $file,
'xml' => ‘xml string here’



Blocks are elements that show data on the page in particular section. There 8 placeholders sections for the blocks on the page.

Header: 8 Locations
Under header: Unlimited locations in order
Above Content: Unlimited locations in order
Below Content: Unlimited locations in order
Left Side: Unlimited locations in order
Right Side: Unlimited locations in order
Above Footer: Unlimited locations in order
Footer: 8 Locations

Each block consist of one MVC set (Controller, View and Model). Each new block should have one unique controller name. As for model and view, these can be multiple. Depending on the placeholder where given block is indented to be used, corresponding template needs to be included.
If you want to give a block ability to be added to any placeholder location, all views/templates needs to be included.

An example of code to add blocks and define templates for all locations.

Code Block
$block_info['block_txt_id'] = 'social_media_set';
$block_info['controller'] = 'social_media_set/social_media_set';
$block_info['templates'] = Array( 

$block_info['descriptions'] = Array( array('language_name' => 'english',
 'name' => 'Social Media Set'),
					   array('language_name' => 'espanol',
  'name' => 'Conjunto de Medios Sociales'));
$layout = new ALayoutManager();


Control Panel Template

There is only one AbanteCart control panel template set per all storefronts or stores. Control Panel default template is located in /admin/view/default/ directory that includes all other components for the template.
It is possible to create new control panel template or extension for it. Unfortunately, we do not provide any instructions for creating custom control panel template yet.