|
Page 1 of 3
|
TopoMotoV3X
Joined: January 2008
Posts: 120
Location: Sardinia/Cagliari
|
[MOD] Tab Menu For Icy
Small Mod that allows you to sostrituire your standard menu with a tab menu is very simple, and above all very discreet on file icy, in fact the changes are relatively few.
* A line of code in every css file of your template (just to call the MOD)
* Inevitable change on overall_header.tpl
* If you use UPI2DB Mod on active or selected by user, you must delete the word "Messages" from on lang_main_upi2db.php for obvious reasons of space.
* Add a new folder in root/templates/icy_phoenix.
The mod is ready for the modified and included installation instructions, for the default templates, for others we will have to make a small change.
ScreenShot:
I am attaching a few buttons optional different templates, created with the default image.
Apple & Milky Way
Frozen Phoenix
Dark Phoenix
MG Autumn
Icy Phoenix
Morpheus
Black Pearl
Blue Pearl
Download
You can see how they work, on my site: Here
Regards. TopoMotoV3X
____________ IP Version: 1.3.0.53b
Server: Linux
Last edited by TopoMotoV3X on Mon 14 Feb, 2011 23:11; edited 1 time in total |
#1 Mon 31 Jan, 2011 00:25 |
|
Sponsors
|
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.
|
|
mort
Spam Basher
Joined: August 2010
Posts: 998
Location: Up a tree
|
Re: [MOD] Tab Menu For Icy
Nice,
But how about trying to add some php code to the default header to make the menu "Location-Smart" so that the buttons stay changed when at a specific location like "viewtopic.php" rather than just a mouseover change - Just like in your picture, the "Forum" button would stay up while one is at that location?
Would possibly save a lot of editing for each template set?
|
#2 Mon 31 Jan, 2011 11:42 |
|
TheSteffen
Joined: August 2006
Posts: 1625
Location: Magdeburg
|
Re: [MOD] Tab Menu For Icy
Great work TopoMotoV3X,
Thanks for sharing it.
____________ TheSteffen
Often SEARCH is the quickest way to get support.
IcyPhoenix German Support
|
#3 Tue 01 Feb, 2011 21:01 |
|
Mighty Gorgon
Luca Libralato
Joined: August 2006
Posts: 7191
Location: Borgo San Michele
|
Re: [MOD] Tab Menu For Icy
Nice,
But how about trying to add some php code to the default header to make the menu "Location-Smart" so that the buttons stay changed when at a specific location like "viewtopic.php" rather than just a mouseover change - Just like in your picture, the "Forum" button would stay up while one is at that location?
Would possibly save a lot of editing for each template set?
In current development version I have added some vars which should easily allow doing that.
'SCRIPT_NAME' => str_replace('.' . PHP_EXT, '', $userdata['page']['page_name']),
This is the main var used for that... which could be used to match the current page without having to insert extra PHP code.
____________ Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
|
#4 Thu 03 Feb, 2011 12:49 |
|
mort
Spam Basher
Joined: August 2010
Posts: 998
Location: Up a tree
|
Re: [MOD] Tab Menu For Icy
Not sure of how that would be applied to menus, but I meant something simple like this:
Create the css class .selected and let the css do the work.
TopoMotoV3X has no doubt spent some time with this, so maybe he would like to take it a bit further?
<?php if (basename($_SERVER['SCRIPT_NAME']) == 'index.php') { ?> <span class="selected"> <?php } else { ?> <span> <?php } ?>
<a href="{FULL_SITE_PATH}{U_PORTAL}">{L_HOME}</a></span> <img src="{FULL_SITE_PATH}{IMG_MENU_SEP}" alt="" />
|
#5 Fri 04 Feb, 2011 02:43 |
|
Mighty Gorgon
Luca Libralato
Joined: August 2006
Posts: 7191
Location: Borgo San Michele
|
Re: [MOD] Tab Menu For Icy
Well... I have created that var just to avoid using PHP code in TPL (this also mean some small speed-up).
You can use like this:
<!-- IF SCRIPT_NAME = "forum" -->FORUM<!-- ELSE -->ELSE<!-- ENDIF -->
Or in any other way you think is appropriate...
<div class="tab-{SCRIPT_NAME}">
And so on...
____________ Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
|
#6 Fri 11 Feb, 2011 11:07 |
|
mort
Spam Basher
Joined: August 2010
Posts: 998
Location: Up a tree
|
Re: [MOD] Tab Menu For Icy
Menus are a cow of a thing, but try to get your mind on this as another way of simplifying it.
[b]$input?? [/b]== basename(_file_)
Translates to:
[b]$index[/b] == basename(_file_)
[b]$search[/b] == basename(_file_)
So the menu looks something like this.
<li{if $index} class="current"{/if}><a href="index.php"><b>Index</b></a></li>
<li{if $search} class="current"{/if}><a href="search.php"><b>Search</b></a></li>
So if one adds anything else (as below) to the "Menu" it will automatically parse the variable.
<li{if $chat} class="current"{/if}><a href="chat.php"><b>Chat</b></a></li>
<li{if $rules} class="current"{/if}><a href="rules.php"><b>Rules</b></a></li>
I'm not really sure as to how this is put together with some other software I use - But it sure is easy to add new "Locations" automatically to the menus, and I'll dig it out if you want to have a look at it - - or tell you where you can get it.
But the simplicity of it is : This: $rules parses to this: rules(.php)
|
#7 Fri 11 Feb, 2011 13:34 |
|
Mighty Gorgon
Luca Libralato
Joined: August 2006
Posts: 7191
Location: Borgo San Michele
|
Re: [MOD] Tab Menu For Icy
I don't know what you wanted to achieve... anyway I have created a PHP function which you can check how it works into the latest dev version of Icy Phoenix for the CMS:
-
/*
-
* Generate tabs
-
*/
-
function generate_tabs($mode)
-
{
-
global $db, $cache, $config, $userdata, $lang, $template;
-
-
$tabs_array = array();
-
-
$tabs_array[] = array('TITLE' => $lang['CMS_TITLE'], 'MODE' => false, 'LINK' => append_sid(IP_ROOT_PATH . $this->root), 'ICON' => IP_ROOT_PATH . $this->menu_images_root . 'cms_home.png', 'TIP' => $lang['CMS_TIP_TITLE'], 'AUTH' => AUTH_REG);
-
$tabs_array[] = array('TITLE' => $lang['CMS_CUSTOM_PAGES'], 'MODE' => 'layouts', 'LINK' => append_sid(IP_ROOT_PATH . $this->root . '?mode=layouts'), 'ICON' => IP_ROOT_PATH . $this->menu_images_root . 'cms_custom_pages.png', 'TIP' => $lang['CMS_TIP_CUSTOM_PAGES'], 'AUTH' => AUTH_REG);
-
$tabs_array[] = array('TITLE' => $lang['CMS_STANDARD_PAGES'], 'MODE' => 'layouts_special', 'LINK' => append_sid(IP_ROOT_PATH . $this->root . '?mode=layouts_special'), 'ICON' => IP_ROOT_PATH . $this->menu_images_root . 'cms_standard_pages.png', 'TIP' => $lang['CMS_TIP_STANDARD_PAGES'], 'AUTH' => AUTH_REG);
-
$tabs_array[] = array('TITLE' => $lang['CMS_BLOCK_SETTINGS'], 'MODE' => 'block_settings', 'LINK' => append_sid(IP_ROOT_PATH . $this->root . '?mode=block_settings'), 'ICON' => IP_ROOT_PATH . $this->menu_images_root . 'cms_blocks.png', 'TIP' => $lang['CMS_TIP_BLOCK_SETTINGS'], 'AUTH' => AUTH_REG);
-
$tabs_array[] = array('TITLE' => $lang['CMS_GLOBAL_BLOCKS'], 'MODE' => 'blocks', 'LINK' => append_sid(IP_ROOT_PATH . $this->root . '?mode=blocks&l_id=0&action=editglobal'), 'ICON' => IP_ROOT_PATH . $this->menu_images_root . 'cms_blocks_global.png', 'TIP' => $lang['CMS_TIP_GLOBAL_BLOCKS'], 'AUTH' => AUTH_REG);
-
$tabs_array[] = array('TITLE' => $lang['CMS_CONFIG'], 'MODE' => 'config', 'LINK' => append_sid(IP_ROOT_PATH . $this->root . '?mode=config'), 'ICON' => IP_ROOT_PATH . $this->menu_images_root . 'cms_settings.png', 'TIP' => $lang['CMS_TIP_CONFIG'], 'AUTH' => AUTH_REG);
-
$tabs_array[] = array('TITLE' => $lang['CMS_MENU_PAGE'], 'MODE' => 'menu', 'LINK' => append_sid(IP_ROOT_PATH . 'cms_menu.' . PHP_EXT), 'ICON' => IP_ROOT_PATH . $this->menu_images_root . 'cms_menu.png', 'TIP' => $lang['CMS_TIP_MENU'], 'AUTH' => AUTH_REG);
-
$tabs_array[] = array('TITLE' => $lang['CMS_ADS'], 'MODE' => 'ads', 'LINK' => append_sid(IP_ROOT_PATH . 'cms_ads.' . PHP_EXT), 'ICON' => IP_ROOT_PATH . $this->menu_images_root . 'cms_ads.png', 'TIP' => $lang['CMS_TIP_ADS'], 'AUTH' => AUTH_REG);
-
-
$tabs_counter = 0;
-
$current_nav = false;
-
foreach ($tabs_array as $tab_data)
-
{
-
$selected = false;
-
if(check_auth_level($tab_data['AUTH']))
-
{
-
if ($mode == $tab_data['MODE'])
-
{
-
$selected = true;
-
}
-
-
$template->assign_block_vars('tabs', array(
-
'TAB_ID' => $tabs_counter,
-
'TAB_TITLE' => $tab_data['TITLE'],
-
'TAB_LINK' => $tab_data['LINK'],
-
'TAB_ICON' => $tab_data['ICON'],
-
'TAB_TIP' => (empty($tab_data['TIP']) ? $tab_data['TITLE'] : $tab_data['TIP']),
-
'S_SELECTED' => $selected,
-
)
-
);
-
$tabs_counter++;
-
}
-
}
-
-
$template->assign_vars(array(
-
'N_TABS' => $tabs_counter,
-
)
-
);
-
-
return true;
-
}
-
File is here:
https://github.com/MightyGorgon/icy...s_cms_admin.php
This function depend on the MODE var, but you can easily replace that with script name.
____________ Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
|
#8 Fri 11 Feb, 2011 15:51 |
|
spydie
Joined: December 2008
Posts: 1796
Location: In the Boxes
|
Re: [MOD] Tab Menu For Icy
looks like, we can also try to archive to get the data from dyn menu table.
working on a mod to create the top menu through dyn menu , adding a new script to take the Cat string out of the menu array.
Idea is, when you create a new Dyn_Menu in CMS,you got an selector to choose between header menu or nav menu block on the right.
i´m thinking of inserting in the overall_header an If - Else condition, so if there is a dyn header menu, the default menu would´nt been called and shown
____________ Out of Order
|
#9 Fri 11 Feb, 2011 16:48 |
|
mort
Spam Basher
Joined: August 2010
Posts: 998
Location: Up a tree
|
Re: [MOD] Tab Menu For Icy
This menu has a problem with languages because it used "Fixed width" tabs.
The only real way to overcome it is to use at least three images per tab (background, left and right) so that it automatically expands to different length words.
The Tab Menu pic shows what I mean.
The Tab Menu2 pic shows one alternative that wraps the words regardless of length, but it has a drawback - Unread Posts use VARIABLES, and one cannot wrap variables because there is no place to slot the code in where it has to go.
And no, I don't want to hijack this thread by discussing Tab Menu2 or other ways to maybe do it - That's for another thread.
Description: |
Tab Menu2 |
Filesize: |
3.62 KB |
Viewed: |
226 Time(s) |
|
Description: |
Tab Menu |
Filesize: |
2.03 KB |
Viewed: |
204 Time(s) |
|
|
#10 Mon 14 Feb, 2011 05:22 |
|
spydie
Joined: December 2008
Posts: 1796
Location: In the Boxes
|
Re: [MOD] Tab Menu For Icy
This menu has a problem with languages because it used "Fixed width" tabs.
The only real way to overcome it is to use at least three images per tab (background, left and right) so that it automatically expands to different length words.
You can do this with 2 images. no need to use 3
____________ Out of Order
|
#11 Mon 14 Feb, 2011 08:20 |
|
mort
Spam Basher
Joined: August 2010
Posts: 998
Location: Up a tree
|
Re: [MOD] Tab Menu For Icy
Yep, I said that badly - The background is to fill the space for the whole width of the menu, unless one uses the default .css for the menu background.
I need to to make more time available to myself.
|
#12 Mon 14 Feb, 2011 08:27 |
|
spydie
Joined: December 2008
Posts: 1796
Location: In the Boxes
|
Re: [MOD] Tab Menu For Icy
i think, you should use the custom background of the template all time.
so the menu fit´s nicely
____________ Out of Order
|
#13 Mon 14 Feb, 2011 09:52 |
|
TopoMotoV3X
Joined: January 2008
Posts: 120
Location: Sardinia/Cagliari
|
Re: [MOD] Tab Menu For Icy
As I said, you have to delete the entry "messages" from the language used, if you do not want to change the language file, will be sufficient eliminate {L_POSTS} to overall_header.tpl
I do not see this problem, note that, in the development version, we no longer have the word "Messages" on upi2db
____________ IP Version: 1.3.0.53b
Server: Linux
|
#14 Mon 14 Feb, 2011 19:49 |
|
mort
Spam Basher
Joined: August 2010
Posts: 998
Location: Up a tree
|
Re: [MOD] Tab Menu For Icy
I do not see this problem, note that, in the development version, we no longer have the word "Messages" on upi2db
No, that wasn't the point I was making - If you look at the German word for "register" in "your" tabs in the picture, it's right to the edges of the tab. They use a lot of longer words than that (I don't think there are any short ones - Easy TheSteffen ), and that may create problems with the layout because the tabs are limited in width.
|
#15 Tue 15 Feb, 2011 00:01 |
|
|
Page 1 of 3
|
Was this topic useful?
Was this topic useful?
Link this topic |
URL |
|
BBCode |
|
HTML |
|
You cannot post new topics You cannot reply to topics You cannot edit your posts You cannot delete your posts You cannot vote in polls You cannot attach files You can download files You cannot post calendar events
|
|
|
|