Re: How to hide a block when it has no contents?

Is the block returning something (like markup), even when there aren't any results? Generally, if $block.content is empty, the block will not display

Christian Web Resources
Facebook
Report
Topic


How to hide a block when it has no contents?

Is there a way that I can make a block hide itself if it has not contents? Say I have a 'recent articles' block, which can be filtered by tag. For some tags, there are no articles, but the title of the block still displays.

What I would like to happen is, if there is no content in a block, it does not display the block title or anything else. It just doesn't display.

I've tried setting $block['title'] = '', or not returning $block, but the title still shows up.

Any ideas?

Report
Topic


Re: Those javascript slideshow things

Thanks! It's a little module that needs some TLC, I agree. Lots of small improvements possible. I'll have a look at doing some of them on a regular basis, and starting a more regular flow of releases.

Don't hesitate if you have some needs or proposals that you'd like to see added

Me on OpenHub

Report
Topic


Re: Those javascript slideshow things

Ok I had a look, that's a great module actually, it should be developed further :)

Report
Topic


Re: Those javascript slideshow things

Ok thanks, I will check out the module.

Report
Topic


Re: Those javascript slideshow things

hehe, @skenow is no fan of those image rotators either, but it's part of what some people expect nowadays.

I created a module called 'billboard' some time ago that allows you to add an image rotator to your site. It needs some work to get it up-to-date on the level of functionality and javascript library. I never had requests for a specific functionality, so I stopped working on it. If you are interested, I could spend some time into adding stuff. Let me know.

When it comes to themes with the functionality hardcoded : http://themes.impresscms.es/ should have some options for you.

Me on OpenHub

Report
Topic


Those javascript slideshow things

Hello, Javascript Idiot here. Can someone please recommend a theme that has one of those image slideshows built into the header? I would like a good example to study the code, but I have no idea what constitutes a good example.

The powers that be have dictated that having lots of huge photos zipping past is more important than, say, actually being able to load the page. You know how it is.

Report
Topic


Re: Help with bootstrap theme - navbar

Got it!

I had moved the form from its original location (just left of the menu items) to the right side. Changed the class to navbar-right and it is doing as I want it to.

I'm still wondering about the different uses of elements for the dropdown - a list item for the login and a div for the user menu. Any thoughts?

Christian Web Resources
Facebook
Report
Topic


Re: Help with bootstrap theme - navbar

The search form is after all the attached code, starting immediately after the last IF closure. It's common for both instances, so something is shifting it or the login/user dropdown (most likely, since this is where the differences are.

<form style="margin-left: 10px;margin-right: 10px;padding-bottom: 8px;padding-top: 8px;" action="<{$icms_url}>/search.php" class="navbar-left"> <input type="text" placeholder="<{$smarty.const.THEME_SEARCH}>" class="form-control" name="query" /> <input type="hidden" name="action" value="results" /> </form>


I'll attach the entire theme.html file ... and some details from Firebug

Array
Christian Web Resources
Facebook
Report
Topic


Re: Help with bootstrap theme - navbar

Hi Steve,
the first code doesn't seem to include the search field declaration, so I'm not sure. My guess would be that the search field is declared first in the logged out portion of the site, and last in the logged-in portion of the theme.

Me on OpenHub

Report
Topic


Help with bootstrap theme - navbar

I've been working on a new theme for a site based on icmsbootstrap3 and have the following tweak to make - the position of the search field changes after logging in and I'd like it to be the same as the logged out position.

Looking at theme.html, the button & dropdown are constructed differently.

Logged out (just uses a li and a b element):

<{if !$icms_isuser}> <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"><{$smarty.const.THEME_PSEUDO}><b class="caret"></b></a> <ul class="dropdown-menu"> <form style="margin-left: 10px;margin-right: 10px;padding-bottom: 8px;padding-top: 8px;" action="<{$icms_url}>/user.php" method="post" class="form-signin navbar-left"> <input type="text" placeholder="<{$smarty.const.THEME_DESC_PSEUDO}>" class="form-control" name="uname" /> <input type="password" placeholder="<{$smarty.const.THEME_DESC_PASSWORD}>" class="form-control" name="pass" /> <{if $rememberme}> <input type="checkbox" name="rememberme" value="On" /><{$lang_rememberme}> <{/if}> <input type="hidden" name="icms_redirect" value="<{$icms_requesturi}>" /> <input type="hidden" name="op" value="login" /> <button class="btn btn-primary btn-block" type="submit"><{$smarty.const.THEME_PSEUDO}></button> </form> <li class="divider"></li> <li><a href="<{$icms_url}>/user.php#lost" title=""><span class="glyphicon glyphicon-warning-sign" style="padding-right:5px;"></span> Forgot your password?</a></li> <li><a href="<{$icms_url}>/register.php" title="<{$smarty.const.THEME_REGISTER}>"><span class="glyphicon glyphicon-user" style="padding-right:5px;"></span> <{$smarty.const.THEME_REGISTER}></a></li> </ul> </li> <{/if}>


Logged in (uses a div and a button element) :
<{if $icms_isuser}> <div class="btn-group" style="margin-left: 10px;margin-right: 10px;padding-bottom: 8px;padding-top: 8px;"> <a href="<{$icms_url}>/user.php" role="button" class="btn btn-default"><span class="glyphicon glyphicon-user" style="padding-right:5px;"></span> <{$icms_uname}></a> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> <span class="caret"></span> <span class="sr-only">Toggle Dropdown</span> </button> <ul class="dropdown-menu" role="menu"> <li><a href="<{$icms_url}>/edituser.php"><span class="glyphicon glyphicon-pencil" style="padding-right:5px;"></span> Edit Profile</a></li> <li><a href="<{$icms_url}>/edituser.php?op=avatarform"><span class="glyphicon glyphicon-camera" style="padding-right:5px;"></span> My Avatar</a></li> <li><a href="<{$icms_url}>/notifications.php"><span class="glyphicon glyphicon-envelope" style="padding-right:5px;"></span> <{$smarty.const.THEME_NOTIFICATION}></a></li> <li><{xoInboxCount assign=pmcount}><{if $pmcount}><a href="<{xoAppUrl viewpmsg.php}>" title="<{$smarty.const.THEME_INBOX}> <{$pmcount}> <{$smarty.const.THEME_NOTREAD}>"><span class="glyphicon glyphicon-comment" style="padding-right:5px;"></span> <{$smarty.const.THEME_INBOX}> <span class="badge badge-info"><{$pmcount}></span></a><{else}><a href="<{xoAppUrl viewpmsg.php}>" title="<{$smarty.const.THEME_INBOX}>"><span class="glyphicon glyphicon-comment" style="padding-right:5px;"></span> <{$smarty.const.THEME_INBOX}></a><{/if}></li> <li class="divider"></li> <li><a href="<{$icms_url}>/admin.php"><span class="glyphicon glyphicon-wrench" style="padding-right:5px;"></span> <{$smarty.const.THEME_ADMIN}></a></li> <li><a href="<{$icms_url}>/user.php?op=logout"><span class="glyphicon glyphicon-off" style="padding-right:5px;"></span> <{$smarty.const.THEME_LOGOUT}></a></li> </ul> </div> <{/if}> <form style="margin-left: 10px;margin-right: 10px;padding-bottom: 8px;padding-top: 8px;" action="<{$icms_url}>/search.php" class="navbar-left"> <input type="text" placeholder="<{$smarty.const.THEME_SEARCH}>" class="form-control" name="query" /> <input type="hidden" name="action" value="results" /> </form> </ul> </div>


I'm sure I could figure it out, but there are others who would be able to do this much quicker than me.

Thanks!

Array
Christian Web Resources
Facebook
Report
Topic


Re: Smarty

  • 2014/8/13 14:00:11

The theme is basically the theme from our company, written by QM-B. I spent a lot of time today to figure out. The main problem was a lot of arrays, which can be created easily in smarty 3. Within the theme he has several arrays in a function, but associative arrays which cannot simple be created in pure smarty 2. So currently I am using the php tag, which allows me to build the array in PHP. Not a nice solution and it blows up the theme, but the most easiest way I found. If you have a better idea, I would be glad to hear.
Easier was the solution I found for tags like

<{$article['category']['title']}>

Quote:

we are currently still using Smarty 2, and as far as I know, nobody has been working on a migration to another theme engine (Smarty 3, Twig, ...).


Think, my answer is yours. QM-B seems to have figured out, since we are using Smarty 3 at work. There are several in-template functions, arrays and other stuff not supported in my current installation. Currently I think, my site would be faster back, if I would wait for QM-B to be back.

Report
Topic


Re: Smarty

Hi Karl,
we are currently still using Smarty 2, and as far as I know, nobody has been working on a migration to another theme engine (Smarty 3, Twig, ...).
The difficulty of such a task is that ImpressCMS (and Xoops before it) are using some Smarty 2 functionalities as part of the base system, such as caching. Smarty is very much woven into the system, so it is a big task to untangle it.
Until now, there was no real demand for a change, as there is much improvement that can be made by simply using smarty in a smarter way
Mr.Theme's work for ImpressCMS 2.0 (and here) demonstrates that very nicely.

To get to your question : it depends on what specific Smarty 3 stuff you are using. If it's a theme that is described or available on the Internet, we could give a look into it and let you know. In most cases, themes don't use many specific smarty elements, so converting a HTML5/CSS theme to an ImpresssCMS theme shouldn't be too hard.

Me on OpenHub

Report
Topic


Smarty

  • 2014/8/13 3:36:41

Not sure if the forum is the right one. I have some trouble with my templates and the "old" smarty inside. In the german forum Rene told me, that I have some custom Smarty features, which I can currently not use, since I haven't the plugin. Ok, I removed them. But in some Templates I still have troubles. After a long time of Google Searches, I found, that my Smarty is in Smarty 3, but not compatible with Smarty 2.
Now the question: Is there any way to re-enable Smarty 3 in Impress? Or would it be faster to use a new theme?

Cheers, Karl

Report
Topic


Re: Remove theme css from a single page

I wonder if that would be useful in combination with symlinks, extending what you can do with symlinks that way

Me on OpenHub

Report
Topic


Re: Remove theme css from a single page

  • 2014/4/9 17:02:03
  • lotus

;)

this works in both directions, of course. You can make it like
if (*smarty* != *sitename) than make *yourstandard.css*

Webdesign: http://netzstrand.de
Report
Topic


Re: Remove theme css from a single page

Hi Chris,
that's nice Smarty template kung-fu there. I hadn't thought of it that way, very nice.

Thanks for sharing!

Me on OpenHub

Report
Topic


Re: Remove theme css from a single page

Hi there,
try this:

<{if $smarty.server.REQUEST_URI=='/modules/XXXX'}> <link rel="stylesheet" href="<{xoImgUrl css/style.css}>" type="text/css" media="screen" charset="utf-8" /><{/if}>


in this example "/modules/XXXX" stands for your URI - the part after your domain. So you have to adjust it.

If you work with symlinks like index.php?fct=sitename* you can also use:
<{if $smarty.get.fct == 'sitename*'}><link rel="stylesheet" href="<{xoImgUrl css/style.css}>" type="text/css" media="screen" charset="utf-8" /><{/if}>


best Greetings,
Chris

Webdesign: http://netzstrand.de
Report
Topic


Remove theme css from a single page

I have a single page I want to display in an I frame but I need it to have it's own style, not the global style. Is there an easy way to do this?

Report
Topic


Re: Anybody got the Belius theme...

Great news! Very useful fetaure

Report
Topic



 Top