Make a Lasting Impression

How create a fancy Theme Select Block

A nice ImpressCMS feature is if you like users or visitors can select themes  But the classic Select Theme Block looks old and if you like play with modern select scripts or HTML5 there is a problem: template file (system_blocks_themes.html) has only one smarty var: <{$block.theme_select}>. All HTML code is in a core php file.

Well, let´s go change.

First edit /modules/system/blocks/system_blocks.php file and replace lines 593-600 with

$block = array();<br />&nbsp;&nbsp; &nbsp;$block['imagenes'] = $options[0];<br />&nbsp;&nbsp; &nbsp;if ($options[0] == 1) {<br />&nbsp;&nbsp; &nbsp;$block['imagenesruta'] =&nbsp; "" . ICMS_THEME_URL . "/" . $icmsConfig['theme_set'] . "/shot.gif" alt="screenshot" width="". (int) $options[1] . "";<br />&nbsp;&nbsp; &nbsp;} <br />&nbsp;&nbsp; &nbsp;$block['numero'] =&nbsp;&nbsp; sprintf(_MB_SYSTEM_NUMTHEME, count($icmsConfig['theme_set_allowed'])) ;<br />&nbsp;&nbsp; &nbsp;$block['opciones'] = $theme_options;<br />

We have now new smarty vars and can play with them in the template file.
    In /modules/system/templates/blocks/system_blocks_themes.html
    replace for
<p>&nbsp;&nbsp; &nbsp;<div style="text-align: center;"><br />&nbsp;&nbsp; &nbsp;<form action="index.php" method="post"><br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<div><br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<{if $block.imagenes}><br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<img src="<{$block.imagenesruta}>" vspace="2" id="icms_theme_img" /><br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br /><br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<select id="theme_select" name="theme_select" onchange="showImgSelected('xoops_theme_img', 'theme_select', 'themes', '/shot.gif',<{$icms_url}>)"><{$block.opciones}></select><br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<input type="submit" value="<{$smarty.const._GO}>" /><br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<{else}><br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<select id="theme_select" name="theme_select" onchange="submit();" size="3"><{$block.opciones}></select><br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<{/if}><br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<p><{$block.numero}></p><br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;</div><br />&nbsp;&nbsp; &nbsp;</form><br /></div><br />

Clear cache

Now you can use mousewheel or fancy select scripts.
No comment

Updating the 1.3 branch

ImpressCMS 1.3.8 is on the horizon, essentially an update of the external libraries with some small bug fixes included.

We decided some time ago to focus new developments on the 2.0 branch,  and to keep the 1.3 branch as a corrective maintenance branch only. Work on the 2.0 branch has accumulated delays, however, and that means that we will need to maintain the 1.3 branch longer than we had anticipated.

With that in mind, it's time to freshen up on our external dependencies such as jquery and other javascript and php libraries. Even though they aren't impacted by security issues, the internet landscape changes fast, and it is good practice to keep up with your environment.

As a consequence, ImpressCMS 1.3.8 should be released in beta in the near future (view the roadmap on Assembla).

The 1.3.8 release of ImpressCMS will also be the first version in the 1.3 branch that will be developed in a Git repository.

No comment

Full Composer integration in ImpressCMS

I'm very proud to announce that I have been able to continue my work on integrating composer into the ImpressCMS core, and that I've been able to adapt ImpressCMS so it uses the composer autoloader completely!

What are the benefits and what does it imply? Lots of benefits, on different levels keep reading ...


Theme select: get out HTML from core and play with template file

A nice ImpressCMS feature is if you like users or visitors can select themes.  But the classic Select Theme Block looks old and if you like play with modern select scripts or HTML5 there is a problem: template file (system_blocks_themes.html) has only one smarty var: <{$block.theme_select}>. All HTML code is in a core php file.

Well, let´s go with changes.

Just look this code and apply the changes in your Impresscms installation.

You have now new smarty vars and HTML code in your template file. Only option tag remains.

However your look block will have not changes. It is normal because it is a matter for themes and templates.

You can now play with candy jQuery scripts as Select Inspiration, Fancy Select, mousewheel or HTML 5 features.

Example using the new code.


No comment

Composer Integration Experiments

Composing ImpressCMS
I'm currently doing a series of experiments with my limited PHP development experience to integrate the composer package management into the ImpressCMS core. This is very PHP-specific hardcore stuff so I'm learning a lot as I go along. I'm not a newbie when it comes to dependency resolution from my Linux time, so I already got the basics. The specific implementation in composer and the design choices made by the team, along with getting to know a complete new ecosystem of packages and tools is really interesting!

My main reason for this approach is that composer is the de facto standard for php package distribution. Package discovery, package installation, dependency resolution and version management are all functionalities that we will need in short order in the ImpressCMS core.

It can be a very complex matter, so it's smart to look out for a proven solution to integrate in ImpressCMS, certainly where looking at functionality that is not really part of the core CMS functionality.

In similar circumstances, having composer integrated in the core (and the composer autoloader scripts as well) will make it much easier to integrate external libraries, and will (hopefully) lead to more cool stuff to come out in the near future.

Many content management systems pride themselves on their extensibility. I believe it's a smart approach. The core team can't take care of all the different specific needs and libraris that people want to integrate for their projects. Let's just make it easier for people to integrate their library of choice into the core.


At the moment, these things are already done:

  • A composer plugin specifically for the installation of ImpressCMS packages is available on github: ... ler-plugin
  • A temporary test repository running on Satis for ImpressCMS composer packages is available now at Contact me to add a composer-enabled ImpressCMS module to it.
  • The development branch of the profile module is composer enabled, and installs without a problem on a clean ImpressCMS installation.

Things still to do

  • A lot
  • making composer autoload work in all cases in the core
  • figuring out how to transform the current impresscms autoloader class into composer directives, so we can switch to using the composer-generated file.
  • moving the external libraries from the 'libraries' folder to composer dependencies. Adapting the core code where necessary.
  • testing how to add external dependencies in modules

I'm currently doing this in my own fork of the core, as this is more of an experiment and I don't want to pollute the official repository with my composer quests.

However, if you feel this is worth pursuing and you want to help me out to get faster to a state where it can be integrated into the next main release, let me know what you can do to help.

Subscribe to latest posts