Forums

Form with No Menu Assignment

DrMopp 20 Apr, 2010
One of my Chronoforms forms has no menu assignment as it is initiated from within an article, using variables from that article. My site has a different banner image assigned to different menu items as the image content is different. Is there any way I can get a banner module to display with the form?
GreyHead 20 Apr, 2010
Hi DrMopp,

I forget exactly how you do it but it is possible to assign a 'hidden' menu item to a page so that it has a menu ItemID but isn't actually visible on a menu.

Bob
nml375 20 Apr, 2010
Hi DrMopp & Bob,
To create a hidden menu, follow these steps:
[list=1]
  • In site-admin, head for Menu Manager. Create a new menu named "dummy" or "hidden".

  • Click the Menu Items link for the new menu. Create your new ChronoForms menu link here.
    Make sure your link is published, and "Display in" is set to your dummy menu.

  • Head for your Module Manager. Create a new module, type "Menu"

  • In Details, setup the various fields as needed. For "Position", enter "hidden" here (it's most likely not available in the dropdown list, so you'll have to type it manually. Doing this will cause Order to go emtpy, but that's ok).
    Parameters: Select your dummy menu in the Menu Name dropdown.
  • [/list:o]
    Now your form should have a valid "Menu Link" (though not rendered by your template, but that does not matter). Just make sure your link to the form uses this URL, rather than http://www.example.com/index.php?component=com_chronocontact&chronoformname=yada&etc. Set up your banner images to your needs with this menu item.

    /Fredrik
    GreyHead 20 Apr, 2010
    Hi Fredrik,

    Many thanks. One for the book . . . if I can find a space.

    Bob
    DrMopp 21 Apr, 2010
    Thanks, but still can't get this to work. Hidden menu item is fine, but though assigned to it, Banner module doesn't appear. Have followed steps as described but problem might be link to form as per your last comment which I didn't fully understand, I currently have <a href="index.php?option=com_chronocontact&chronoformname=Enquiry&id=1080">, does this need to change and if so how?
    nml375 21 Apr, 2010
    Hi Bob, DrMopp:
    You're welcome, Bob. How's the book going?

    DrMopp, you'll have to use the link of the menu-item, as this is the only way for Joomla to figure we're actually "using" the menu-item. The exact URL will vary depending on SEF-settings on your site setup - the easiest way to get the link would probably be to assign the Menu module a visible position ('left' usually works well, but this would be template dependant.) and reload the page. Now you should see the menu and the link - Now retrieve the URL by: clicking the link, right-click->show source, or right-click->copy link, or some other way your browser provides and you find convenient.
    Once you got the URL, change the Menu module position back to 'hidden', and paste the link in your article.

    One thing you'll notice though, is that by default, ChronoForm uses a submit-URL such as "http://www.example.com/index.php?option=com_chronocontact&task=send&chronoformname=theformname". This will not match the Menu-link, so the image will disappear again. This can be solved however, with a little creative tinkering of your form;
    First, set your submit URL to the same Menu-link that we got earlier. This takes care of the Menu-item identification..
    Next, we need to add a hidden field to your Form code:
    <input type="hidden" name="task" value="send" />

    This will instruct ChronoForms that we're submitting data from the form, not loading the form itself.

    /Fredrik
    DrMopp 21 Apr, 2010
    Fredrik, I put the menu in a visible position and got the url which is http://www.mydomain.com/enquiryform.html, but I need the link to pass parameters i.e. the referring article id, which it can do currently as the link is index.php?option=com_chronocontact&chronoformname=Enquiry&id=1080 - how do I do that if it's just html not php?
    nml375 21 Apr, 2010
    Hi DrMopp,
    Then add the id parameter to the URL:
    http://www.mydomain.com/enquiryform.html?id=1080

    Don't worry 'bout the .html extension, your webbrowser won't care (atleast not when it comes to submitting form data), and the Joomla system is clever enough to figure which page to load from within the Joomla CMS by extracting the enquiryform.html-part of the URL (which just happens to be the alias of the menu-link with .html attached to it).

    /Fredrik
    DrMopp 21 Apr, 2010
    Fredrik,
    Success! Thanks so much for your help, and patience!
    This topic is locked and no more replies can be posted.