Make a Lasting Impression

Join the Mailing List

Who's Online

11 user(s) are online (2 user(s) are browsing ImpressCMS Blog)

Members: 0
Guests: 11

more...
ImpressCMS proudly uses SourceForge
ImpressCMS on Ohloh.net

Different theme styles for different modules

You have a nice theme for your ImpressCMS site, but what of you would like use different styles for each site section, as news, downloads, wiki, etc. There are themes with different colors; why uses only one color if you can use all availables? Here if Smarty tag shows its power. Let´s go!

Imagine the theme have four colors in different CSS files. They are: default.css, blue.css, orange.css, black.css and your start page use news module.


Edit the theme.html file and look for CSS files. Now change the code according this example:

!-- Sheet Css -->

<{if $icms_dirname == "news"}>

<link rel="stylesheet" type="text/css" media="all" href="<{$icms_imageurl}>default.css" />

<{elseif $icms_dirname == "simplywiki"}>

<link rel="stylesheet" type="text/css" media="all" href="

<{$icms_imageurl}>blue.css" />

<{elseif $icms_dirname == "downloads"}>

<link rel="stylesheet" type="text/css" media="all" href="<{$icms_imageurl}>orange.css" />

<{else}>

<link rel="stylesheet" type="text/css" media="all" href="<{$icms_imageurl}>black.css" />

<{/if}>

2 comments

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>
<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 ...

1 comments

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.

themesselect1
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.

themesselect2

No comment
Pages:
Subscribe to latest posts