Welcome to the new home of the BlestaCMS, rebranded as the new BlestaCMSPro. If you're looking for the Community Edition please visit the documentation for that instead.

So after going Public the BlestaCMS hasn't improved much, it's done the job we needed however we believe it is due for a facelift and more features. So to help us keep the development going we've decided to keep that open for the community and the Pro will be for everyone else who would like a feature rich plugin for Blesta.

The Pro takes the features we love from the Community Edition CMS and added more to it, as-well as re-writing the core and database structure. We wanted a fresh start and a fresh look.

Installation

Upload the zip to your blesta root normally /home/username/public_html/, then extract the zip.

Head over to the settings page on Blesta: Settings > Company > Plugins then hit "Install" on the BlestaCMSPro.

Transfer

As most of our customers still use the old BlestaCMS and would like to migrate to the BlestaCMSPro, we have a special migration tool. This tool will allow you to import all the databases to the new BlestaCMSPro. All you need to do is upload the migration plugin and hit install.

You can get the migration tool from the BlestaCMSPro plugin zip. It's called cms_importer.

1. Upload the new CMSPro plugin to your Blesta installation.

2. Install the CMSPro plugin, so it creates the database.

3. Install the CMS Importer plugin, this will run the import.

4. Run the Importer, go to Tools > CMS Importer & Press the Red buttons to import all the tables you have content in.

5. uninstall the CMS Importer and BlestaCMS plugins.

Get Started

So this if your first time integrating the BlestaCMS into your Blesta installation.

All you need to do is add the following to your: /app/views/client/boostrap/structure.pdt

Main Integration:

<?php
        Loader::loadModels($this, array("cmspro.Pages", "cmspro.Menus", "cmspro.Footer"));
        if ($this->Html->ifSet($logged_in)) {
        $client_group = $this->Menus->grabClientGroup($contact->client_id);
        $menu_items = $this->Menus->getAllMenusAndSubmenus($client_group);
        }else{
        $menu_items = $this->Menus->getAllMenusAndSubmenus('0');
        }
        $footer_links = $this->Footer->getAllFooterLinks();
        $footer_categories = $this->Footer->getAllFooterCategories();
        $lang = $this->Pages->getCurrentLang();
        $default_lang = $this->Pages->getAllLang()[0]->uri;
?>

You can edit and remove features you don't need, for example if you're not using the Footer Links,
remove the , "cmspro.Footer" and the following from the above code:

 $footer_links = $this->Footer->getAllFooterLinks();
$footer_categories = $this->Footer->getAllFooterCategories();

You will need to put the following code where you would like your BlestaCMS Pro menu to be. We have different variety of choices to choose from.

Basic:

<div class="nav-content">
        <div class="nav">
          <nav class="navbar navbar-default" role="navigation">
            <div class="container">
              <div class="row">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#cms-navbar" aria-expanded="false">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    </button>
                </div>
                <div class="collapse navbar-collapse" id="cms-navbar">
                    <ul class="nav navbar-nav">
                      <?php
                        if(!empty($menu_items)){
                          foreach ($menu_items as $item) if ($item->parent == '') {
                      ?>
                      <li>
                        <a href="<?php if($item->target != 'newtab'){ ?>//<?php echo $this->Html->safe(trim($system_company->hostname . $this->Html->safe(WEBDIR) . ($default_lang == $lang ? null : $lang . '/') . ($item->uri == '/' ? null : $item->uri)), ''); }else{ echo $item->uri; } ?>" <?php if($item->target === 'newtab'){ ?>target="_blank"<?php } ?>
                          <?php if (!empty($item->childs)) { ?>aria-expanded="false" class="dropdown-toggle" data-toggle="dropdown"<?php } ?>>
                          <?php echo $this->Html->ifSet($item->title[$lang], $item->title[$default_lang]); ?>
                          <?php if (!empty($item->childs)) { ?>
                            <b class="caret"></b>
                          <?php } ?>
                        </a>
                        <?php
                          if (!empty($item->childs)) {
                        ?>
                        <ul class="dropdown-menu">
                          <?php
                            foreach ($item->childs as $child) {
                          ?>
                          <li>
                            <a href="<?php if($child->target != 'newtab'){ ?>//<?php echo $this->Html->safe(trim($system_company->hostname . $this->Html->safe(WEBDIR) . ($default_lang == $lang ? null : $lang . '/') . ($child->uri == '/' ? null : $child->uri)), ''); }else{ echo $child->uri; } ?>" <?php if($child->target == 'newtab'){ ?>target="_blank"<?php } ?>>
                              <?php echo $this->Html->ifSet($child->title[$lang], $child->title[$default_lang]); ?>
                            </a>
                          </li>
                          <?php } ?>
                        </ul>
                        <?php
                          }
                        ?>
                      </li>
                    <?php } ?>
                  </ul>
                  <?php
                    }
                  ?>
              </div>
            </div>
          </div>
        </nav>
      </div>
    </div>

Blesta Navigation

We've found that hiding the Blesta Navigation is best for the CMS because it can look untidy and out of place so we recommend you show it when needed. You can do it by using the following navigation code:

<?php if (strpos($_SERVER['REQUEST_URI'], "client") || strpos($_SERVER['REQUEST_URI'], "plugin") || strpos($_SERVER['REQUEST_URI'], "order") !== false){
	if (!$this->Html->ifSet($logged_in)) {
?>
<div class="clearfix"></div>
<div class="no-nav"></div>
<?php }else{ ?>
<div class="nav-content <?php if( strpos($_SERVER['REQUEST_URI'], "plugin") ){echo "navbar-plugins";} ?>" style="margin-top: 0px;">
	<div class="nav">
		<nav class="navbar navbar-default" role="navigation">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
					<span class="sr-only"><?php $this->_("AppController.sreader.navigation");?></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
				</button>
			</div>

			<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
				<div class="container">
					<?php
					$active_nav = null;
					?>
					<ul class="nav navbar-nav">
						<?php
						foreach ($this->Html->ifSet($nav, array()) as $link => $value) {
							$attributes = array();
							$link_attributes = array();
							$dropdown = !empty($value['sub']);
							$active = false;

							if ($value['active']) {
								$active = true;
								$attributes['class'][] = "active";
								$active_nav = $value;
							}
							if ($dropdown) {
								$attributes['class'][] = "dropdown";
								$link_attributes['class'][] = "dropdown-toggle";
								$link_attributes['data-toggle'][] = "dropdown";

								// Set parent to active if child is
								if (!$active) {
									foreach ($this->Html->ifSet($value['sub'], array()) as $sub_link => $sub_value) {
										if ($sub_value['active']) {
											$attributes['class'][] = "active";
											break;
										}
									}
								}
							}
						?>
						<li<?php echo $this->Html->buildAttributes($attributes);?>>
							<a href="<?php $this->Html->_($link);?>"<?php echo $this->Html->buildAttributes($link_attributes);?>>
								<i class="<?php $this->Html->_($value['icon']);?>"></i>
								<?php
								$this->Html->_($value['name']);

								if ($dropdown) {
								?>
								<b class="caret"></b>
								<?php
								}
								?>
							</a>
							<?php
							if (!empty($value['sub'])) {
							?>
							<ul class="dropdown-menu">
								<?php
								foreach ($this->Html->ifSet($value['sub'], array()) as $sub_link => $sub_value) {
								?>
								<li>
									<a href="<?php $this->Html->_($sub_link);?>"><i class="<?php $this->Html->_($sub_value['icon']);?>"></i> <?php $this->Html->_($sub_value['name']);?></a>
								</li>
								<?php
								}
								?>
							</ul>
							<?php
							}
							?>
						</li>
						<?php
						}
						?>
					</ul>

					<ul class="nav navbar-nav navbar-right">
						<li class="dropdown">
							<a href="#" class="dropdown-toggle" data-toggle="dropdown">
								<?php $this->Html->_($contact->first_name);?> <?php $this->Html->_($contact->last_name);?>
								<b class="caret"></b>
							</a>
							<ul class="dropdown-menu">
								<li><a href="<?php echo $this->Html->safe($this->client_uri . "main/edit/");?>"><i class="fa fa-edit fa-fw"></i> <?php $this->_("AppController.client_structure.text_update_account");?></a></li>
								<li><a href="<?php echo $this->Html->safe(WEBDIR);?>members"><i class="fa fa-circle-o fa-fw"></i> <?php $this->_("AppController.client_structure.text_return_to_portal");?></a></li>
								<li class="divider"></li>
								<li><a href="<?php echo $this->Html->safe($this->client_uri . "logout/");?>"><i class="fa fa-sign-out fa-fw"></i> <?php $this->_("AppController.client_structure.text_logout");?></a></li>
							</ul>
						</li>
					</ul>
				</div>
			</div><!-- /#header .navbar-collapse -->
		</nav>
	</div>
</div>
<?php
		 }
	}
?>

Footer links are a new feature in the BlestaCMS Pro this allows you to customise everything from the top to the bottom with Blesta itself. Simply do put the following:

<?php foreach( $footer_categories as $foot_cat ){ ?>
<div class="col-sm-4">
 <p class="footer-sub-links">
   <b><?php echo $foot_cat->cat_title[$lang]; ?></b>
 </p>
 <ul>
 <?php foreach( $footer_links as $foot_link ) if( $foot_link->parent == $foot_cat->fcid ){ ?>
   <li><a href="<?php if($foot_link->target == '-'){ ?>//<?php echo $this->Html->safe(trim($system_company->hostname . $this->Html->safe(WEBDIR) . ($default_lang == $lang ? null : $lang . '/') . ($foot_link->uri == '/' ? null : $foot_link->uri)), ''); }else{ echo $foot_link->uri; } ?>" <?php if($foot_link->target != '-'){?>target="_blank"<?php } ?>><?php echo $foot_link->title[$lang];?></a></li>
 <?php } ?>
 </ul>
</div>
<?php } ?>

Get the latest blog posts

So would you like to show the latest blog posts on your website, maybe the footer? All you need to do is the following.

Find the top integration code:

Loader::loadModels($this, array("cmspro.Pages", "cmspro.Menus", "cmspro.Footer"));

Replace it with:

Loader::loadModels($this, array("cmspro.Pages", "cmspro.Menus", "cmspro.Blogs", "cmspro.Footer"));

This gives you access to the Blog posts model, so you can load the functions. Next add the following code where you want the latest blog posts to be, edit as needed:

<ul>
   <?php
       $latest_posts = $this->Blogs->getLatestPost();

       if (!empty($latest_posts)) {
         foreach ($latest_posts as $post) {
     ?>
         <li>
           <a href="<?php echo $this->Html->safe($this->base_uri . 'blog/' . $post->uri); ?>">
             <?php echo $this->Html->safe($post->title[$lang]); ?>
           </a>
         </li>
     <?php
         }
       }
     ?>
</ul>

Migration

So you would like to migrate from the BlestaCMS Premium or BlestaCMS Community Edition to the BlestaCMS Pro. All you need to do is the use the Importer tool, then edit your theme (client template).

Main Integration:

Find:

Loader::loadModels($this, array("BlestaCms.CmsPages"));
$menu_items = $this->CmsPages->getMenuItemsWithChilds();
$html_dir = (in_array($this->_('AppController.lang.dir', true), ['ltr', 'rtl']) ? $this->_('AppController.lang.dir', true) : 'ltr');
$html_lang = (!empty($language) ? substr($language, 0, 2) : 'en');
$lang = $this->CmsPages->getCurrentLang();
$default_lang = $this->CmsPages->getAllLang()[0]->uri;

Replace with:

Loader::loadModels($this, array("cmspro.Pages", "cmspro.Menus", "cmspro.Footer"));
  if ($this->Html->ifSet($logged_in)) {
    $client_group = $this->Menus->grabClientGroup($contact->client_id);
    $menu_items = $this->Menus->getAllMenusAndSubmenus($client_group);
  }else{
    $menu_items = $this->Menus->getAllMenusAndSubmenus('0');
  }
  $footer_links = $this->Footer->getAllFooterLinks();
  $footer_categories = $this->Footer->getAllFooterCategories();
  $lang = $this->Pages->getCurrentLang();
  $default_lang = $this->Pages->getAllLang()[0]->uri;

You can edit and remove features you don't need, for example if you're not using the Footer Links,
remove the , "cmspro.Footer" and the following from the above code:

 $footer_links = $this->Footer->getAllFooterLinks();
$footer_categories = $this->Footer->getAllFooterCategories();

Replace Navigation

Every Navigation is different so I've put the main parts to it below, you can just copy and replace them.

Find:

<a href="<?php if($item->target != 'newtab'){ ?>//<?php echo $this->Html->safe(trim($system_company->hostname . $this->Html->safe(WEBDIR) . ($default_lang == $lang ? null : $lang . '/') . ($item->uri == '/' ? null : $item->uri)), ''); }else{ echo $item->uri; } ?>" <?php if($item->target === 'newtab'){ ?>target="_blank"<?php } ?>
    <?php if (!empty($item->childs)) { ?>aria-expanded="false" class="dropdown-toggle" data-toggle="dropdown"<?php } ?>>
    <?php echo $this->Html->ifSet($item->title[$lang], $item->title[$default_lang]); ?>
    <?php if (!empty($item->childs)) { ?><i class="fa fa-angle-down"></i><?php } ?>
</a>

Replace with:

<a href="<?php if($item->target != 'newtab'){ ?>//<?php echo $this->Html->safe(trim($system_company->hostname . $this->Html->safe(WEBDIR) . ($default_lang == $lang ? null : $lang . '/') . ($item->uri == '/' ? null : $item->uri)), ''); }else{ echo $item->uri; } ?>" <?php if($item->target === 'newtab'){ ?>target="_blank"<?php } ?>
    <?php if (!empty($item->childs)) { ?>aria-expanded="false" class="dropdown-toggle" data-toggle="dropdown"<?php } ?>>
    <?php echo $this->Html->ifSet($item->title[$lang], $item->title[$default_lang]); ?>
    <?php if (!empty($item->childs)) { ?>
    <b class="caret"></b>
    <?php } ?>
</a>

Find:

<?php
    foreach ($item->childs as $child) {
?>
  <li>
    <a href="<?php if($child->target != 'newtab'){ ?>//<?php echo $this->Html->safe(trim($system_company->hostname . $this->Html->safe(WEBDIR) . ($default_lang == $lang ? null : $lang . '/') . ($child->uri == '/' ? null : $child->uri)), ''); }else{ echo $child->uri; } ?>" <?php if($child->target == 'newtab'){ ?>target="_blank"<?php } ?>>
      <?php echo $this->Html->ifSet($child->title[$lang], $child->title[$default_lang]); ?>
    </a>
  </li>
<?php } ?>

Replace with:

<?php
    foreach ($item->childs as $child) {
?>
  <li>
    <a href="<?php if($child->target != 'newtab'){ ?>//<?php echo $this->Html->safe(trim($system_company->hostname . $this->Html->safe(WEBDIR) . ($default_lang == $lang ? null : $lang . '/') . ($child->uri == '/' ? null : $child->uri)), ''); }else{ echo $child->uri; } ?>" <?php if($child->target == 'newtab'){ ?>target="_blank"<?php } ?>>
      <?php echo $this->Html->ifSet($child->title[$lang], $child->title[$default_lang]); ?>
    </a>
  </li>
<?php } ?>

Find:

<ul>

Replace with:

<?php
   if (!empty($item->childs)) {
?>
  <ul class="dropdown-menu">

Find:

</ul>

Replace with:

</ul>
<?php
 }
?>

Customization

Customising your BlestaCMS Pro installation is very easy, we've listed a few popular edits.

How to change a theme css folder:

You can set the CSS Folder colour by setting a CSS Folder value.
For example if the theme says set it to blue, it will use the blue css folder.

Developers

Blesta loves developers and so do we, we've made it so easy for developers to create pages and their clients can instantly create them when installing the plugin.

Allow customers to change the theme css colours:

In your Blesta integration at the top add , "cmspro.System" and the following code $theme_colour = $this->System->getSetting('template')->settings_3;

You can now use the following statement to set the CSS folder:<link href="<?php echo $this->view_dir;?>css/<?php if(empty($theme_colour)){ ?>themename.css<?php }else{?>themename<?php echo '-'. $theme_colour; ?>.css<?php } ?>" rel="stylesheet" type="text/css" />

That code means that if it's the CSS Folder is not set it uses themename.css this is your default css. If there is a colour set it will use themename-colour.css. So if it's blue it will use themename-blue.css.

AALayer

AALayer is an official partner of Blesta.store and builds fantastic templates and integrations for Blesta and the BlestaCMS. When you purchase an intgeration you know it's 100% working and compatible with the BlestaCMS Pro.

List of supported Integrations:

How to install a integration?

To install an AALayer integration is very simple, simply do the following:

Upload the BlestaCMS Pro to your Blesta installation.

Upload the Integration from AALayer to your blesta installation, the folder is called cms theme.

Go to Settings > Company > Plugins > Available and hit install on the BlestaCMS Pro.

Finally go to Settings > Company > Look and Feel > Templates (Left hand side) and change it to Theme Name CMS and hit save.