Jump to content
TNG Community

Deep linking


mwilbers

Recommended Posts

Hi all,

I use Joomla to present my TNG pages. This works just fine fot me. My only problem is "deep linking". Google indexes my TNG pages, and when you find one of my TNG pages, Joomla doesn't get loaded, just the TNG page.

Now I'm looking for code, preferably JavaScript, to detect this. And after detection, load Joomla with the TNG page or just Joomla with my TNG start-page.

I got a pretty good idea how this should be working, only, I'm not any good with JavaScript (or PHP, for that matter ;-) )

I think it should test the parent-document presence or name, and if not correct, load the Joomla page.

Something like this.

if this.parent.location = present or name="something" then "OK"

else load("http://www.blablabla")

Does anyone have this kinda code on hand, or is able to write me some kind of example?

After I get it to work, I'll share it here on the forum, ofcourse!

Much appreciated

Maarten

Link to comment
Share on other sites

Hi,

I found the solution! And it's even more simple than I thought.

<script language="javascript">
    if (self==parent)
    {location.href="http://www.maartenwilbers.nl/index.php?option=com_wrapper&Itemid=61"};
</script>

I load my TNG in a "wrapper", as Joomla calls it, which is actualy an iFrame.

So if the TNG frame (=self) had no parent frame, the test is "true", and it reloads the page in the Joomla environment.

As simple as that! :-P

Maarten

Link to comment
Share on other sites

  • 2 weeks later...

Hi Maarten.

That's interesting - Something I have been thinking about as well.

Where do you place that piece of script?

Also how do you handle the Iframe's double scroll bar?

Thanks

Blair

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...