You may consider using ajax to do this.
you can assign a handler based on the blocktitle, and when your button is clicked it would hide/show them. As far as position, you could quite easily use the same block for all of this, or code the whole series right into the theme.
Let me see, you want each main menu link to display submenus items in a unique block?
Maybe you can use just one multimenu and then clone the block.
You change one of the blocks to only show main links.
You change the second block to dislpay only sublinks.
Quote:
<td id="button2"><a {show_hide_blocks}>Elementary</a></td>
Why there is "a" ?
Whats the content of function?
Hi, I need to call a smarty function and I am not sure on the syntax. For example, my function is called show_hide_blocks and I want to call it like this
<td id="button2"><a {show_hide_blocks}>Elementary</a></td>
This syntax is wrong and I am not sure how to correct it. When my mouse is over the button it no longer behaves like a button. It is just text on the page. The smarty function is in /class/smarty/plugins but I haven't included it in the theme.html page where I am calling it from because I am assuming that plugin functions are always available and no need to include them. Adding an onclick to the above doesn't help in any way.
Hi, I have 5 buttons across the top of the page which organise my content into various logical groups such as Home, Elementary, MiddleSchool, HighSchool etc. When a user clicks a button, for example 'Elementary' I want MultiMenu01, which is responsible for displaying the Elementary submenus to be visible and when the user presses 'MiddleSchool' I want multiMenu01 to be hidden and multiMenu02 to become visible in exactly the same location as multiMenu01. i.e. multiMenu01 is hidden and underneath multiMenu02. And so on.....
Is there a smarty property for controlling whether a particular multiMenu block is hidden or visible - something like $block.01.hidden == true
I cannot find any reference to properties such as above. Is there a listing showing all the smarty variables(particularly the block variables) somewhere? For example I know that {$block.mm} is the current activated multiMenu block but what properties does it possess? I apologise for my doubleposting but I thought that this warranted a new topic after all.
Hi,
I am developing a icms site for my school, and I am using the brighthost theme from Mr.Theme, MultiMenu and pico. The brighthost puts 5 buttons across the top of the page and I want to link these to 5 MultiMenu blocks 01 to 05, one block for each button. The thing is I want all the blocks to be in the same position on the topleft and I want to hide or show them depending on which brighthost button is pressed. This is going a step further from just hiding or showing a title, I am interested in the whole block. I have written a basic php function called function.show_hide_block.php which I put into the smarty/plugins folder. This file contains the function below:-
function smarty_function_show_hide_blocks () {
if (is_array($xoops_lblocks)) {
foreach $xoops_lblocks as $block {
if ($block.title !== 'Elementary') {
include file="$xoops_theme/blocks/theme_blockleft.html"
}
}
}
}
Into the theme I put the following line
<td id="button2"><a {show_hide_blocks}>Elementary</a></td>
I am trying to keep everything simple at this stage(no parameters passed to the function yet) just to get something basic working. I was hoping that the line above would call the function and hide the Elementary multiMenu block. However, it did not and hence this post. I cannot use an onclick in the above line. It doesn't like it I guess because it is a javascript construct. i.e. <td id="button2"><a onclick="{show_hide_blocks}">Elementary</a></td> doesn't work. I haven't been able so far to find a theme or a template that already does what I am attempting. There has to be a simple smarty variable that hides or shows an entire block and a way for the blocks to be located in the same position.
Any help would be appreciated.
thanks aph3x,
I only use WinXP and didn't see that. I have fixed it now
Firefox 2.0.0.14 OS X Leopard
thank you,
the header in FF and IE7 look ok. which browser do you use?
looking nice :)
I see an issue on xoops-theme.com's header ..where "all themes are compatible with impresscms" appears behind the "There are now 112 xoops themes in the gallery", other then that site's theme is brilliant where left-right blocks are awesome
Excellent,
Do you have a press release for this, for the news section?
I have ported the clouds theme
demo and download at xoops-theme.com
Thank you, I will try to fight with it.
OK, there are two strategies, using Smarty and hacking the code:
Via Smarty - Check every new item's category id against an array of past items. If the number appeared before, skip this item, otherwise store it's category ID into the array. Not sure how to push a new value into an array via Smarty.
Hacking the code - Much simpler but dirty: clone or hack the block, locate the DB query and add a DISTINCT clause. it will guarantee you there will be only one item per category.
Ok :) I did it as you wrote, and here goes the content of debug:
http://pastebin.org/31498
Eek, I forgot debuggind a block is a pain in the ass.
What you need is to check $block.items object to see if there's any property that tells us the category of every news item. If this property does exist, the rest can be done using Smarty.
Try deactivating debug console and putting this at the end of the block template:
I have to mention that I am using first case here: $block.display_type='block'
Code of included template is here:
http://impresscms.svn.sourceforge.net/viewvc/impresscms/modules/smartsection/trunk/templates/smartsection_singleitem_block.html?revision=331&view=markup&pathrev=1766
Here is whole info from debug console as I wasn't 100% sure what to give you, I decided to paste everything.
http://pastebin.org/31477
Sorry I don't use SmartSection, need some info. Can you paste the smarty boject $block.items as it's given by the Smarty debug console?
Hello, I've got a question.
I am diplaying a spotlight block on the start page of website. And I've got X categories and what I want to achieve it to show 1 item from each category...
I suppose it might be not so difficult but Im noob in this kind of issue.
Here is that template: