I use a number of menu items like this …InterestsList?x_I_SetPaining=1&z_I_SetPaining=%3D&cmd=search…to get a specific sub-list. It would be good if the resulting list page could also include the title of the search.I presume I could add it to the end of the url for the menu item -
… &cmd=search&mytitle=Set%20Painting
but how would I retrieve this and display it on the list page??Thanks
Browsing here I found some alternative suggestion to use the Menu title in the page header which would be good.
This suggested:
Language()->setProjectPhrase(“BodyTitle”, Language()->TablePhrase(CurrentPage()->TableName,“TblCaption”));
in Page_RenderDoesn’t seem to work for me. so how can I get the menu title into the page header??
Thanks
It seems you’re using v2021, then please try:Language()->setProjectPhrase(“BodyTitle”, Language()->tablePhrase(CurrentPage()->TableName,“TblCaption”));
The BodyTitle is for the tag, not the page header. You may set the argument $header in Page_DateRendering server event.
$header = Language()->tablePhrase(CurrentPage()->TableName,“TblCaption”); in Page_DataRendering gives me the table caption - as expected.
What I really want is the the Menu item title out of the menu editor. How do I get that?I’m happy to put it in with $header but even better would be to replace the existing list page heading with it.
Thanks
sclg wrote:
What I really want is the the Menu item title out of the menu editor. How do I get that?
Then you may simply enter the same text for Table Captions and Menu Text from Tools → Multi-Language Property Editor.
That won’t work because I have about 10 menu items which are all the SAME table but just with different search parameters in the menu URL.
They display members’ interests. (Theatre website)
So the table is called “Members Interests” but the menu items are called “Acting”, “Costumes”, “Lighting”, etc, etc, and each menu uses a menu URL like
InterestsList?x_I_Acting=1&z_I_Acting=%3D&cmd=searchAt the moment, ALL the menu items bring up a page headed “Members Interests” so there is no indication of which one they selected.
What I want is for the different pages to be headed something like “Members Interests - Costumes”, “Members Interests - Acting” , etc
i.e. using Table Captions AND Menu Text.
Please post the URL for each the following pages for more discussion.Acting: InterestsList?x_I_Acting=1&z_I_Acting=%3D&cmd=search
Costumes: …
Lighting: …
sclg wrote:
each menu uses a menu URL like InterestsList?x_I_Acting=1&z_I_Acting=%3D&cmd=search
Then you may check if keys of the URL parameters (i.e. $_GET), e.g. if the key x_I_Acting exists, then you can set the header as “Acting” by removing the prefix.
Here are some of the menu entry URLs…
InterestsList?x_I_Acting=1&z_I_Acting=%3D&cmd=search
InterestsList?x_I_BackStage=1&z_I_BackStage=%3D&cmd=search
InterestsList?x_I_SetDesign=1&z_I_SetDesign=%3D&cmd=search
InterestsList?x_I_SetPaining=1&z_I_SetPaining=%3D&cmd=search
InterestsList?x_I_StageManagement=1&z_I_StageManagement=%3D&cmd=search
InterestsList?x_I_Lighting=1&z_I_Lighting=%3D&cmd=search
InterestsList?x_I_Sound=1&z_I_Sound=%3D&cmd=search
So, does it mean you only have one menu item for those 7 pages, or do you have 7 menu items for those 7 pages?
arbei wrote:
Then you may check if keys of the URL parameters (i.e. > $_GET> ), e.g. if the key > x_I_Acting > exists, then you can set the header as “Acting” by removing the prefix.
e.g.
$header = Get("x_I_Acting") ? "Acting" : Get("x_I_BackStage") ? "BackStage" : ...<your other cases>... : $header; // Complete the code yourself
If you have a lot of cases, you may get the header dynamically by writing some code to check array_keys($_GET).Note: An even more simpler way is to pass the header in your URL directly (e.g. InterestsList?x_I_Acting=1&z_I_Acting=%3D&cmd=search&header=Acting), then you may easily get the header by Get(“header”).
mobhar wrote:
So, does it mean you only have one menu item for those 7 pages, or do you have 7 menu items for those 7 pages?
7 menu items
Try arbei’s suggestion above:$header = Get(“x_I_Acting”) ? “Acting” : Get(“x_I_BackStage”) ? “BackStage” : Get(“x_I_SetDesign”) ? “SetDesign” : Get(“x_I_SetPaining”) ? “SetPaining” : Get(“x_I_StageManagement”) ? “StageManagement” : Get(“x_I_Lighting”) ? “Lighting” : Get(“x_I_Sound”) ? “I_Sound” : $header;