This topic is locked

Conditional menu

6/11/2008 5:04:05 PM
PHPRunner General questions
V
vytb author

I've been seeing several posts on conditional formating, conditional redirecting, conditional visibility of fields...
Is there a possibility to hide menu tabs/links depending on the value inserted in the previous action without the need to edit generated pages?

J
Jane 6/17/2008

Hi,
sure you can hide any links on the menu tab.

For example check entered value in the After record added/updated event and save result in the $_SESSION variable:

if ($values["FieldName"]=="some value")

$_SESSION["show_link"] = 1;

else

$_SESSION["show_link"] = 0;


Then edit menu page in HTML mode on the Visual Editor tab. Here is a sample:

{if $show_link}

<A href="TableName_list.php">TableName</A>

{/if}



and add following code to the Menu page: Before display event:

$smarty->assign("show_link",$_SESSION["show_link"]);

$_SESSION["show_link"] = 0;

V
vytb author 6/22/2008

Hi,

sure you can hide any links on the menu tab.

For example check entered value in the After record added/updated event and save result in the $_SESSION variable:
Then edit menu page in HTML mode on the Visual Editor tab. Here is a sample:
and add following code to the Menu page: Before display event:


Where should I edit page in HTML?

J
Jane 6/23/2008

Hi,
proceed to the Visual Editor tab and turn on HTML mode.

V
vytb author 6/23/2008

I understand... but where to put your code on the page?

J
Jane 6/24/2008

Hi,
find actual link on the menu page and add smarty variables around this link.

Here is a sample:

{if $show_link}

<A href="TableName_list.php">TableName</A>

{/if}