CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 How to implement a Menu to CCS5

Print topic Send  topic

Author Message
icp4all

Posts: 37
Posted: 02/13/2012, 10:20 AM

Hi all,

i�m just trying to implement a menu to an artisteer design made with the last version of artisteer.
The point is "TRYING"^^ ...
It seems, that there is no menutemplate generated by artisteer.

So every suggestion would be a great help to me.

Thx Hans
View profile  Send private message
mor

Posts: 119
Posted: 02/14/2012, 12:30 AM

Insert yours menu (set of <li><a href="#">ItemName</a></li>) into panel "Menu" on page with applying Design. It's work's for me :)
_________________
Mor ve Ötesi
View profile  Send private message
icp4all

Posts: 37
Posted: 02/19/2012, 11:57 PM

Yes a static Menu works fine. But a database driven menu with submenues made with the assistent is a different thing.
View profile  Send private message
joejac

Posts: 242
Posted: 02/20/2012, 1:08 PM

Hello icp4all,

Long time ago I realized that it is a terrible headache when trying to customize a menu after it has being generated by the menu builder, and even worst if Artisteer is used.

So I decided to forget those and I did the following Dynamic Database driven PHP/MySQL menu for my CCS projects. With the styles it can be customized either vertical or horizontal drop down menu:

1.- To generate a grid with the grid builder for the menu, it will get someting like this:
in your HTML code of your menu page:

   
<div id="menu">   
   {category_name}  
    </div>  
 

2.- In the before show event of category_name
   
  global $locale;  
	global $CCSLocales;  
    $locale = CCGetParam("locale","es");  
      
    global $Header;  
    global $DBcmsascp1;    
  $TempStr ="";  
  $MenuLevel ="topmenu";  
  $MenuUl = display_children(1,1,$TempStr,$MenuLevel,$locale);  
  $Header->category_name->SetValue($MenuUl);  
//Header is my menu page and DBcmsascp1 is my connection.  
 

3.- In the begining of your menu page, in my case Header_event.php, copy the following function:
  
<?php  
// //Events @1-F81417CB  
  
function display_children($parent, $level, $TempStr, $MenuLevel, $locale) {  
 $DB = new clsDBcmsascp1();  
  
$TempStr = "<ul class = '".$MenuLevel."'>";  
  
      $SQL = "SELECT a.category_no, a.category_name, a.category_enmenu, a.category_orden, Deriv1.Count FROM `".$locale."_categories` a  LEFT OUTER JOIN (SELECT parent_category_no, COUNT(*) AS Count FROM `".$locale."_categories` GROUP BY parent_category_no) Deriv1 ON a.category_no = Deriv1.parent_category_no WHERE a.parent_category_no=" . $parent . " AND a.category_enmenu = 1 ORDER BY a.parent_category_no ASC, a.category_orden ASC, a.category_name ASC";  
	    $DB->query($SQL);  
      while ($DB->next_record()) {  
  
		$CatNO    = $DB->f(category_no);  
		$Name   = $DB->f(category_name);  
		$Cuenta   = $DB->f(Count);  
		$ParentNO  = $DB->f(parent_category_no);  
  
		if ($Cuenta > 0) {  
                $TempStr .= "<li><a href='index.php?category_no=" . $CatNO . "&locale=".$locale."' onclick='Javascript:return false;'>" . $Name . "</a>";  
				  $MenuLevel ="submenu";  
	            $TempStr .= display_children($CatNO, $level + 1, $TempStr, $MenuLevel, $locale);  
	            $TempStr .= "</li>";  
			  
	        } elseif ($Cuenta==0) {  
	            $TempStr .= "<li><a href='index.php?category_no=" . $CatNO . "&locale=".$locale."'>" . $Name . "</a></li>";  
	        } else;  
	    }  
	    $TempStr .= "</ul>";  
  
		$DB->close();  
		return $TempStr;  
	}  
 
Please adjust the SELECT with the fields that you need.

4.- The style for the menu:
  
* { padding:0px; margin:0px; }  
body { font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; color:#333333; }  
#menu { position:relative; z-index:10000; margin:0 0 0 -1px;  width:1028px; height: 38px;}  
#menu li {float:left;width:171px; height: 38px; margin:0; padding:0; text-align:center;}  
#menu li a {text-decoration:none; margin:0}  
#menu li a, #menu li a:visited {display:block; width:170px; height:37px; background:transparent url(../es/sitio/MenuCustomer.jpg) left top; text-indent:0px; color:#6d8bb0; text-decoration:none; font:italic normal bold 14px/34px verdana; padding: 0;}  
#menu li a:hover {background-position:left center; color:#fff;}  
#menu li a#selected, #menu li a#selected:hover {background-position:left bottom; line-height:34px; cursor:default; color:#000;}  
  
.topmenu {list-style-type:none; margin:0; padding:0; position:relative;}  
.submenu {z-index:100000; list-style-type:none; position:relative; left:-10000px;}  
.topmenu li:hover > ul {left:100%; margin-top:-30px; margin-left:-1px; padding-left:0px;}  
 

Please be aware that the image: MenuCustomer.jpg has all the 3 images of the 3 states for the menu buttons, the styles shift the image, I only use link and hover.

Please change: clsDBcmsascp1 for your connection.

I took the idea from here:
http://wizardinternetsolutions.com/web-database-design/...menu-php-mysql/

Hope this can help.
Best regards
joejac
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.