Shortcodes Cheatsheet Menu name

Joomron 17 Mar, 2022
Hi,
​
question is there a shortcode for menu name with ChronoForms 7 & Joomla 4.x
​
Right now, I'm using {document:title} but I would like to use the name of the menu item.

Regards Ron πŸ˜€
Colnem 18 Mar, 2022
Hi
​
You can use a PHP Action:
​
echo $_SERVER['PHP_SELF'];
​
Bye
Joomron 18 Mar, 2022
Thanks for your comment, Colnem.
​
Is there a guide for this somewhere? Because I am not a PHP expert πŸ˜‰

Regards Ron πŸ™‚
Colnem 18 Mar, 2022
What do you want? Just display item menu?
Joomron 18 Mar, 2022
Every menu item has its own name. I want to put this in the form line.

See image link ---> https://ibb.co/tKgBFR5
Colnem 18 Mar, 2022
Hi
​
Set an Action/Advanced/PHP. For example, php_10
In this action, write...
return $_SERVER['PHP_SELF'];
​
Then, to display your message, use https:/{var:php_10}
​
Bye
Joomron 18 Mar, 2022
Hi Colnem,
​
thanks for the script.
​
Is this for 1 menu item?

I have with my old Joomla 3 site 100 cars, I have their one chronoforms form that I use for all cars.
And use the browser title with this code ---> {document:title}
[strong]
[/strong]With your code, I get the same effect for all 100 cars? Or do I have to submit a form for each car?

The new Joomla 4 site almost ready, I want to use the name of the menu instead of the browser title because I have my reasons.
[br]Regards Ron πŸ™‚
Joomron 18 Mar, 2022
Hi,

I'm looking for something like the code below, but I don't know how to process this in my form.
$menu = &Jsite::getMenu();
$menuname = $menu->getActive()->title;
Regards Ron πŸ˜€
Joomron 22 Mar, 2022
Hi,
​
nobody to help?😟

I won't the name of menu item with my code, and otherwise they code from Colnem.

Only I can not find user manual for Chronoform7 where this is normally described.
​
Regards RonπŸ™‚
GreyHead 24 Mar, 2022
Hi Ron,
​
Have you tried your code in a Custom PHP action?
​
CFv7 does include some data automatically but I doubt that the Menu name is included (possibly the ID). You can enable the Debugger action temporarily to see what is available.
​
Bob
You need to login to be able to post a reply.