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

 Component, menus and forms reuse

Print topic Send  topic

Author Message
jeanmtl

Posts: 6
Posted: 01/18/2005, 10:20 AM

I have successfully implemented the CSS horizontal and vertical menu examples for my application.

The problem is that for every new page I have to recreate the menus. If I make a change I have to recopy it on every page.

The ideal situation would be to implement the menus as part of a project template which would appear on each new page.

The CCS templates do not allow for server side components.

What is the best strategy in order to implement a project with standard dynamic menus?

The same applies to other components. If for example one needs the same search or login form to appear on each page.

_________________
Jean Georgiadis
TI BIZVISION
www.tibizvision.com
jeang@tibizvision.com
View profile  Send private message
GeorgeS

Posts: 206
Posted: 01/18/2005, 12:11 PM

includes

_________________
GeorgeS
View profile  Send private message
jeanmtl

Posts: 6
Posted: 01/19/2005, 8:33 AM

Thank you. I have been trying to use includes in order to achieve this and it works after some tweaking around. I hope this is the correct way to proceed and that it might help someone else.

I created an includable page called "maintemplate" with a directory component called "hmenu" which gives me a horizontal menu as the examplepack2. It works fine when I use it as a standalone not includable page but when I include it in a new page called "NewPage1"

I get the following error:

"Notice: Undefined property: TemplatePath in
D:\www\htdocs\isi\maintemplate.php on line 98"

After browsing the forum I added the following code in the before show event of the hmenu component in the maintemplate file, and everything works fine.

"$mainheader->TemplatePath = "";"

Then I proceeded to add a vertical menu using the Label component in my maintemplate file.

This dit not work. The label gave me a nice vertical manu when used in a non includable file. When I make the maintemplate includable and execute NewPage1 which includes maintemplate, I get the following error message:

Fatal error: Call to a member function on a non-object in D:\www\htdocs\isi\maintemplate_events.php on line 94

I had to add a global variable in the before show event of the label

global $maintemplate;

and reference my Label object as

$maintemplate->Label1->SetValue($MenuUl);
instead of //$Label1->SetValue($MenuUl);
used in the example pack 2


_________________
Jean Georgiadis
TI BIZVISION
www.tibizvision.com
jeang@tibizvision.com
View profile  Send private message
dekacode

Posts: 53
Posted: 01/19/2005, 6:21 PM

Hi,
Could you post/explain your workaround code.
I followed your post, but don't understand $mainheader:
i.e. "$mainheader->TemplatePath = "";"

Thanks
View profile  Send private message
Ronald
Posted: 01/24/2005, 1:51 AM

Links in included file should be absolute, not relative!
That prevents you from getting the error msg:

"Notice: Undefined property: TemplatePath in
D:\www\htdocs\isi\maintemplate.php on line 98"

For this, check every link in the included page and set the "Convert Url To" property to Absolute.
jeanmtl

Posts: 6
Posted: 01/24/2005, 7:08 AM

I set every link to absolute in the includable page, and everything works fine. I no longer need the workaround code. Thanks
_________________
Jean Georgiadis
TI BIZVISION
www.tibizvision.com
jeang@tibizvision.com
View profile  Send private message
GeorgeS

Posts: 206
Posted: 01/24/2005, 4:05 PM

Now I'm confused.

I have both Horizontal & Vertical menus created as includable files and they work fine when incuded without ANY of the tricks listed above as well as changing links to Absolute...



_________________
GeorgeS
View profile  Send private message
Hantoush
Posted: 04/05/2005, 2:44 PM

I am trying to include the menu in another an HH form using the VCSSMenu example .. I have made the following changes :

global $VCSSMenu;

$db = new clsDBIntranetDB();
$MenuUl = CCDLookUpTreeToUL("menu_id", "menu_name", "menu_id_parent", "menu_link" ,"menu", "", "menu_name", $db);

$VCSSMenu->Label1->SetValue($MenuUl);


I created a form called HH and included the VCSSMenu form but still I got the error :
"Fatal error: Call to a member function on a non-object in e:\program files\apache group\apache\htdocs\ccsexample\VerticalCSSMenu\VCSSMenu_events.php on line 67
"

the error is refferring to "$VCSSMenu->Label1->SetValue($MenuUl);"
so what is wrog ??

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.