News:

Wondering if this will always be free?  See why free is better.

Main Menu

Navigation Section/Breadcrumb

Started by [chrisB], February 01, 2023, 10:30:03 AM

Previous topic - Next topic

[chrisB]

Is it possible to edit the navigation section/breadcrumb to remove the index.php part?

Editing the QueryString.php to remove the 'index.php' causes issues with the css/images loading, but I have a menu editor mod whereby I can link to 'mydomain.com/' however, the breadcrumb will always show 'mydomain.com/index.php'. I know this is very minor but if I can't remove it - the next best method would be to hide its use.

It's just a personal preference.
I'm stuck in a time warp from the early 00's.

Sir Osis of Liver

Are you referring to the linktree or browser tab?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Kindred

in short... NO.

DO NOT attempt to remove the index.php from the URL. You will cause all sorts of errors.
The system was designed to have it present -- and all attempts that people have tried to remove it ALWAYS result in difficulties.

You can use something like PrettyURLs, but do not change the code in the Source files.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

[chrisB]

#3
Quote from: Sir Osis of Liver on February 01, 2023, 11:30:21 AMAre you referring to the linktree or browser tab?

It could be the linktree, I'm not sure what SMF refers to it as but when I used the inspect tool it shown it as 'navigation section' - basically the bar underneath the main menu.

Forum > Boards > ETC

Quote from: Kindred on February 01, 2023, 01:27:36 PMin short... NO.

DO NOT attempt to remove the index.php from the URL. You will cause all sorts of errors.
The system was designed to have it present -- and all attempts that people have tried to remove it ALWAYS result in difficulties.

You can use something like PrettyURLs, but do not change the code in the Source files.

At the moment I am using PrettyURLs and a menu editor.

I'm going to re-add the 'index.php' to the QueryString.php file but I was hoping there would be some way of safely masking the index.php from being shown at all.

-Edit-

Yes it is the treelink, I have found the code for it inside index.template.php file.
I'm stuck in a time warp from the early 00's.

Illori

if you remove any code related to this at some point you WILL break your forum. please take our advice and dont do this.

TwitchisMental

Could be wrong here, but couldn't this be done with CSS?

.navigate_section ul li a:first-child {
  display: none;
}

[chrisB]

Quote from: Illori on February 01, 2023, 05:07:18 PMif you remove any code related to this at some point you WILL break your forum. please take our advice and dont do this.
Rodger that, I have changed the URL to my sites logo (that should be fine).

Also, if someone does stumble on index.php - I have set it to redirect via my htaccess file.

Quote from: TwitchisMental on February 01, 2023, 05:16:09 PMCould be wrong here, but couldn't this be done with CSS?

.navigate_section ul li a:first-child {
  display: none;
}


Thanks, I don't want to hide the whole thing but its useful to know.

Could the 'site' part of the navigate section be hidden with css? https://poetryartonline.com/index.php?cat=2
I'm stuck in a time warp from the early 00's.

TwitchisMental

Quote from: [chrisB] on February 01, 2023, 05:45:11 PM
Quote from: Illori on February 01, 2023, 05:07:18 PMif you remove any code related to this at some point you WILL break your forum. please take our advice and dont do this.
Rodger that, I have changed the URL to my sites logo (that should be fine).

Also, if someone does stumble on index.php - I have set it to redirect via my htaccess file.

Quote from: TwitchisMental on February 01, 2023, 05:16:09 PMCould be wrong here, but couldn't this be done with CSS?

.navigate_section ul li a:first-child {
  display: none;
}


Thanks, I don't want to hide the whole thing but its useful to know.

Could the 'site' part of the navigate section be hidden with css? https://poetryartonline.com/index.php?cat=2

The code I mentioned would just remove the first link. Although on the main page I guess it would hide the whole thing unless you made another tweak or two.

Not sure if you could remove just that specific part from the breadcrumb with just css though.

Kindred

Removing the index.php in the url uding htaccess will also break things unless you are using the full pretty URLs system
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

[chrisB]

Quote from: Kindred on February 01, 2023, 07:17:45 PMRemoving the index.php in the url uding htaccess will also break things unless you are using the full pretty URLs system

I have the Pretty URLs Pro mod, nothing seems broken by using this setup so far.

I appreciate the help and advice. 👍🏻
I'm stuck in a time warp from the early 00's.

Sir Osis of Liver

I'm still not getting this.  index.php is not normally displayed in linktree.  Screenshot?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Illori

Quote from: Sir Osis of Liver on February 01, 2023, 07:54:26 PMI'm still not getting this.  index.php is not normally displayed in linktree.  Screenshot?


yes it is, all the links have index.php in them

Sir Osis of Liver

Are we talking about the browser nav bar?  Why would anyone want to change that?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Kindred

No, he's talking about the URLs in the linktree...   URLs that no one ever actually looks at since they are "behind" the words of the linktree

Some people actively try to break their forum for some imaginary benefit...  ad while it shouldn't break anything changing those, it's basicslly useless work that could make upgrading harder
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Sir Osis of Liver

But.... You only see the url at bottom of browser when you mouseover link, and in top nav bar when you click on it.  IIRC, there was another issue with index.php in earlier version (2.0?) that was fixable, but can't remember what it was.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

[chrisB]

Quote from: Kindred on February 01, 2023, 08:44:03 PMSome people actively try to break their forum for some imaginary benefit...  ad while it shouldn't break anything changing those, it's basicslly useless work that could make upgrading harder
It's more for consistency for me.

Most modern scripts no longer have index.php in their urls - I don't wish to sound disrespect towards SMF as it's a good solution for community building. In the future, I suppose FURLs will come to SMF as default.

mydomain.com
mydomain.com/forum/

Is my preferred preference.

It's worth noting that it could break things or, make upgrading harder down the line. I personally don't see what the few changes I have done could cause any problems. If the linktree can't safely be changed, I'm not overly bothered. Yet I will ask, then reflect on what's said or achievable.
I'm stuck in a time warp from the early 00's.

Advertisement: