Forum Moderators: coopster

Message Too Old, No Replies

How to set Homepage button in the correct way?

         

toplisek

10:27 am on Sep 19, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I like to control server side button which links to Homepage. As I understand all other pages inside log placement need to be linked to Homepage due to usability issues.

Is there some example how to do it with the PHP support/server side?

lucy24

6:48 pm on Sep 19, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



There are lots of ways, notably including my way and the right way ;) Do you have any php-based navigation on your site already, or is this a completely new venture?

In general you want to avoid pages linking to themselves, if only because it bugs the ### out of users. So your php will involve something that passes the current pagename to the function that builds the navigation. The code will then behave differently depending on whether the menu item (or Home link) refers to the present page.

toplisek

9:01 am on Sep 30, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



There are templates and raw links. As some templates use the same template as Homepage I have to do it server side. Please post PHP code that passes the current pagename and avoids Homepage link inside Homepage.

penders

8:16 am on Oct 7, 2014 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Not sure that I understand? The "homepage" is presumably "/", so what's stopping you from simply linking to the URL "/"?

In general you want to avoid pages linking to themselves,


This isn't necessarily a bad thing. The link can be styled in CSS to look different - if that is a problem. Many sites do this (often by linking the page title) to provide an easy canonical link back to the page, which also allows the user to refresh the page without resubmitting any form data.