Author Topic: nbill using &tmpl=component  (Read 1014 times)

Offline Andy

  • Jr. Member
  • **
  • Posts: 18
    • View Profile
nbill using &tmpl=component
« on: 17/June/2011, 04:07:41 PM »
I'd like to use modal or new windows to guide users through the buying process on my website without having them distracted by anything else on the site.

I can use '&tmpl=component' to do this but as soon as you click the 'Next' button the screen returns to it's normal self and doesn't persist the '&tmpl=component' in the original url.

Does anyone know of a way to do this?

Thanks
« Last Edit: 17/June/2011, 04:51:29 PM by Andy »

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,959
    • View Profile
Re: nbill using &tmpl=component
« Reply #1 on: 17/June/2011, 08:10:54 PM »
I haven't tried, but I would guess that you would need to add a hidden field to all forms that are output in the front-end (typically by overriding the functions within the front-end 'pages' folder) to preserve the value of that parameter, eg:

<input type="hidden" name="tmpl" value="<?php echo nbf_common::get_param($_REQUEST, 'tmpl'); ?>" />

Offline Andy

  • Jr. Member
  • **
  • Posts: 18
    • View Profile
Re: nbill using &tmpl=component
« Reply #2 on: 19/June/2011, 07:22:33 AM »
Yes that works.

In the pages folder I created an override for the function 'form_display' within 'orders.custom.html' and added the following code to the end of the function:

?>
        <input type="hidden" name="tmpl" value="<?php echo nbf_common::get_param($_REQUEST, 'tmpl'); ?>" />
<?php

I also included the following code in the header to make the process of logging in smoother, if the user has an account they can login and will be returned to the nbill form to carry on seamlessly:

<div>
            If you already have an account then please <a href="index.php?option=com_user&view=login&return=<?php echo base64_encode(JURI::getInstance()->toString());?>&tmpl=component">
         <?php echo JText::_('LOGIN');?> here...
         </a>
            </div>
« Last Edit: 19/June/2011, 09:17:53 AM by Andy »