Welcome to Geeklog, Anonymous Monday, December 23 2024 @ 04:10 am EST

Geeklog Forums

The default welcome link trailing slash: where does it come from?


Status: offline

dinsdale

Forum User
Newbie
Registered: 01/04/05
Posts: 7
Where does the trailing slash in the link to the root directory that appears in the header template (header.thtml) come from? Here's the relevant code:


Text Formatted Code
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="header-welcomeanddate">
<tr>
<td> <a href="{site_url}">{welcome_msg}</a><br> {datetime}</td>
</tr>
</table>
 


It's not showing up in my installation of 1.3.11. I notice that it appears on this site, and the header file does not include a trailing slash after {site_url}. That variable is assigned a url in config.php without a trailing slash, per instructions. If a slash is added, you get double slashes in all links save the one in question here, I think. My workaround has been to add the slash to the header file. But I shouldn't have to do this, right?

Thanks for your attention.
 Quote

Status: offline

dinsdale

Forum User
Newbie
Registered: 01/04/05
Posts: 7
Tap, tap, tap, hello, does anyone want to try answering this question? Neutral
 Quote

ted

Anonymous
the slash that you are talking about is not added by the code, but by the browser. if you don't want double slashes in other places then don't add the slash. hope that helps. or did I misunderstand?
 Quote

Status: offline

zipstart

Forum User
Chatty
Registered: 09/13/04
Posts: 60
It actually is added by the code in lib-common...look around line 591.

Text Formatted Code
            case 'home':
                $url = $_CONF['site_url'] . '/';
                $label = $LANG01[90];
                break;
 
 Quote

dinsdale

Anonymous
Thanks for your replies. I'm glad there's some interest in this question, after all.

In reply to zipstart, that line of code you quoted is for the default menu_elements that are configured in config.php. I checked lib-common.php anyway, and the slash was indeed there where you said it would be. But that doesn't affect the welcome line in the header template. If you activate 'home' in config.php, it'll show up in the menu bar at top (in the default professional theme).

In reply to anon, it's true the browser automagically adds a trailing slash when you click on a directory link lacking a trailing slash. But here's the difference I'm talking about: If you place your mouse over the welcome link at geeklog.net you see the trailing slash. When I do the same thing on my current set-up, there's no trailing slash.

How'd day do dat? Neutral
 Quote

Status: offline

dinsdale

Forum User
Newbie
Registered: 01/04/05
Posts: 7
The above is my reply. Forgot to log on. Doh! - that was a mistake
 Quote

Status: offline

zipstart

Forum User
Chatty
Registered: 09/13/04
Posts: 60
Gah. Yer right. lib-common's not your culprit.

I think ted is right...view your page source. On mine there is no trailing slash, but mouseover shows one. Go figure.
 Quote

Status: offline

dinsdale

Forum User
Newbie
Registered: 01/04/05
Posts: 7
I'd checked that possibility out after my last post. I saw that the geeklog.net source did not have the trailing slash appended to the link in question. The mouseover event seems to work only if the link is to the root directory of the domain, I think. I haven't tested that theory yet, as I've been working from a subdirectory.
 Quote

ted

Anonymous
subdir or not, if you do not not have a page explicit in the url, the slash will appear to indicate a directory. this is a browser/server accomodating http. Directory names accessed thru http should end in a / and browsers/servers know this.
 Quote

All times are EST. The time is now 04:10 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content