Return to site without wrapper

Discussion in 'Customization & add-ons' started by nc3man, Mar 21, 2011.

  1. nc3man

    nc3man aMember Pro Customer

    Joined:
    Sep 30, 2010
    Messages:
    42
    I have aMember Pro wrapped in our current site. Everything works well except when a user logs out of aMember, the return is to our home page, for example, http://northcountycycleclub.com. Since aMember is wrapped, the user sees our "site within our site." The user can easily return to our home page with one click, but it does confuse some. This is in JOOMLA. Any suggestions? Is there any script mod to "break the wrapper" and return to our home page as normal?
  2. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    You can try this in your home page:

    Code:
    <script type="text/javascript">
    	<!--
    		if (top.location!= self.location) {
    			top.location = self.location.href
    		}
    	//-->
    </script>
  3. nc3man

    nc3man aMember Pro Customer

    Joined:
    Sep 30, 2010
    Messages:
    42
    brilliant

    Worked like a charm. My simple index.htm redirects to the sub-folder with our joomla install scripts. I am including my entire index.htm source for anyone else to follow:
    Code:
    <html><head>
    <META http-equiv="refresh" content="0;URL=http://northcountycycleclub.com/web/index.php">
    <script type="text/javascript">
       <!--
          if (top.location!= self.location) {
             top.location = self.location.href
          }
       //-->
    </script>
    </head>
    </html>
    
    One last question. I also had an equivalent index.php which did the redirect as in:
    Code:
    <?php
      header( 'Location: http://northcountycycleclub.com/web/index.php' );
      exit();
    ?>
    
    Is there an easier php-only mod to index.php instead of the javascript which I put into index.htm?
  4. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    Well you can use the same javascript in your PHP script (via echo or via include, depending on how you want to do it)..

    This is a client side issue (the client side browser frame) so a server side PHP function will not help.

    The above is as simple as it gets :)

Share This Page