This topic is locked

How to add menu to View, Add and Edit pages

11/16/2011 2:53:40 PM
PHPRunner Tips and Tricks
Sergey Kornilov admin

You can add menu to any page that initially doesn't support it in three easy steps. This will require a bit of layout modification.

  1. Let's assume you use a layout with horizontal menu like Eindhoven and we need to add the menu to the Edit page. Proceed to the Style Editor and make sure Edit page is selected on the left side.
    Now we need to find what layout file to modify. Click 'Project layouts' link and choose 'Apply to the current page'. This shows that we use edit page layout file edit2.ly.


2. Proceed to C:\Program Files (x86)\PHPRunner6.0\templates\layouts and open edit2.ly file in any text editor. Add menu container (in bold).

beginblock width=100% center

begincontainer horizontal bmargin=0 style=hmenu align=center width=500 hmenu

brick hmenu

endcontainer

begincontainer vertical style=1 width=500 align=center edit

header color2 editheader

brick color1 message

begincontainer vertical columns=3 color=1 style=fields width=100% fields

header editfields

brick color3 legend

brick color2 editbuttons

endcontainer

endcontainer

begincontainer vertical style=empty align=left width=500 details

brick editdetails

endcontainer

endblock


3. Add the following code to BeforeDisplay event of the Edit page. If you don't add it - menu won't appear which is convenient if you don't need it to be on each Edit page.

$xt->assign("menu_block",true);


Just in case here is ASPRunnerPro equivalent of this code:

xt.assign "menu_block", true


This is it. Here is how it looks in generated application.


More info about Layouts structure:

http://xlinesoft.com/phprunner/docs/layouts.htm

500503 11/16/2011

nice!

but why not just have a couple of check boxes in phprunner that does this for you?

Just wondering.. it seems like it would be a convenient option right in the program.

Patti

500504 3/27/2012

ok so I have the menu as a horizontal on top on the view page now how do I put the menu vertical in the left container of a view page?

and what happens the next time I use the London layout? Also the menu shows up on all of my view pages even though I put $xt->assign("menu_block",false); in

Sergey Kornilov admin 3/27/2012

This is now a built-in feature, simply choose layout with menu when you setup View page in Style Editor.

500505 3/27/2012



This is now a built-in feature, simply choose layout with menu when you setup View page in Style Editor.



I'm using 6.0 build 9824 and I don't see a "layout with menu"

Sergey Kornilov admin 3/27/2012

I guess you need to get the latest build.

500506 3/28/2012

ok so could you point me to the correct update? which version or build do I want?
Patti