1
philroy
Making "Home" link appear off main page
  • 2004/1/23 21:28

  • philroy

  • Friend of XOOPS

  • Posts: 107

  • Since: 2003/8/23


Hi all,

In the new design I'm working on, most of my main links run along the banner/header area of the site. Problem is, once you are away from the main page, there's no obvious way to get back to it.

I could just put in a "Home" link and leave it there, even on the main page, but I think that's poor design (yes, I know, fussy)....but I was wondering if there is any way to script something that says....

if....the current URL is not *exactly* the same as the site URL
show the "home" link
end if

I'm not a coder...just a hacker of others code, so I'm stuck on the first part....asking XOOPS to figure out what the current URL is?

If there is a better way, or if my idea is not a good one, please let me know.

Cheers,

Phil

2
philroy
Re: Making "Home" link appear off main page
  • 2004/1/31 8:59

  • philroy

  • Friend of XOOPS

  • Posts: 107

  • Since: 2003/8/23


Anyone?

Phil

3
carnuke
Re: Making "Home" link appear off main page
  • 2004/1/31 9:53

  • carnuke

  • Home away from home

  • Posts: 1955

  • Since: 2003/11/5


Hi Phil

Not exactly what you are asking for .... however the top panel has a logo image to the left, with an existing link to home. Any way you could utilise this?

4
philroy
Re: Making "Home" link appear off main page
  • 2004/1/31 10:06

  • philroy

  • Friend of XOOPS

  • Posts: 107

  • Since: 2003/8/23


Yeah, I do use that, thanks...but some people don't realise. Could just be done with it and have a static "Home" link that does show on even the main page, but I was trying to be clever.

Anyone else?

Phil

5
kahumbu
Re: Making "Home" link appear off main page
  • 2004/1/31 16:04

  • kahumbu

  • Documentation Writer

  • Posts: 277

  • Since: 2003/8/23


Found this idea to be interesting so I took a whack at it.

First, you need to turn Smarty Debugging on to find out the $SCRIPT_NAME of your home page. And then, this should get you started:

<{if $SCRIPT_NAME !== "[color=CC0000]your script name[/color]"}>

<
a href="<{$xoops_url}>">Home</a>

<{/if}>


Just adjust that script to your needs. Hope it helps.

[edited by poster]

6
philroy
Re: Making "Home" link appear off main page
  • 2004/1/31 20:41

  • philroy

  • Friend of XOOPS

  • Posts: 107

  • Since: 2003/8/23


OK...first of all....thank you! That's working great. I figured I probably would trigger the interest of someone wanting to figure it out. Thanks you so much!

A couple of things to note..

1. If you're a Mac user like me, make sure if you are using Safari in this process that you aren't blocking pop-up windows (I didn't even realise I was). It wasn't until looked at the source code that I realised a pop-up window was meant to be appearing. So, I switched to Mozilla and got the info I need.

2. In the code above, remove the "// Enter your home link" part or else that appeared on the page too

The only thing that now concerns me is the info that appeared during smarty debug! Should a site be error free? There were repeated messages on the page about a line in the theme index it didn't like. Should I look at fixing that or is that quite normal?

Phil

7
kahumbu
Re: Making "Home" link appear off main page
  • 2004/1/31 20:53

  • kahumbu

  • Documentation Writer

  • Posts: 277

  • Since: 2003/8/23


Quote:

2. In the code above, remove the "// Enter your home link" part or else that appeared on the page too

Sorry about this one. I did not use this in the original script I tested, but added that here for emphasis. I will probably edit that for 'cut and paste' purposes.

Quote:

The only thing that now concerns me is the info that appeared during smarty debug! Should a site be error free? There were repeated messages on the page about a line in the theme index it didn't like. Should I look at fixing that or is that quite normal?

I'm not really sure about this one. I have been led to believe from the various posts in this forum that Smarty errors are not that serious, although I do not find these errors in my site--just the pop-up window.


Login

Who's Online

146 user(s) are online (74 user(s) are browsing Support Forums)


Members: 0


Guests: 146


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits