Breadcrumbs nav in Wappler Editor

I’m running a project with lots of “index.php” files, and i think it would be useful to have a breadcrumb navbar (and why not a directory reference placed in the tab).

Like vs:

Btw, i know is not the best technique having lots of index files, but is what i got today.

Hi @franse, I think that for exactly this same reason this can’t be a Feature Request:

Looks like more a bad structure or design of the project. Generally index files are used for security purpose in subfolders in php.
The best is to rename that files and add a propper structure even without the use of frameworks.

1 Like

Sorry i’m not following you.
I have each index in a different subfolder:
root/index.php
root/login/index.php
root/help/index.php

No to be argumentative, but as an alternative. you could have

root/index.php
root/login/login.php
root/help/help.php

Then, with routing, you would have the same effect as naming the files index.

1 Like

Most of time index files (index.php, index.html, etc) are used to disable directory listing, it’s a simple empty file with index as name. Every subfolder need to have this to not allow directory listing.

If index.php is the main file with the web info that’s means that you call sub folders instead of files and you are not able to have more files inside the same folder at least that you explicity call it directly with all the path ending with the extension (/login/login.php).

File .htaccess works in conjuntion with php files, you can write rules (RewriteRule) to point to specific file into a folder as @ben correctly says and show empty index.php with DirectoryIndex , e.g.,

root/index.php
root/login/login.php
root/help/help.php

The great about this is that Wappler create that routes for you inside .htaccess, so you only have to worry about to create routes inside Wappler.

With Wappler routing you can have something like this without writing extension at end, that’s call URL rewriting. More info here: About the Routing and URL Rewrite category

/login
/help
/about
/about/offices
/services
/services/portfolio
/services/clients
etc, etc.

Routing example with the real path could be:

/login/login.php         ----> /login
/about/about.php     -----> /about
/about/offices.php    -----> /about/offices

Sorry if made some mistake, I’m writing this rapidly.

2 Likes

I opened this same FR a while ago.

Why not have…

index.php
login.php
help.php
about.php
services.php

and use routing so they’re all visited like this:

/
/login
/help
/about
/services
2 Likes

Well, first, thank you all for taking the time and leave the replies, i really apreciate it.
Then i must say that we’ve been misunderstanding the topic i’ve created.
Having only 2 files with the same name, is enough, the structure of the site here, is irrelevant.

I’m aware of using routing. In fact, i use it for every new project.
But there’s a thousand of sites being created with the structure i’ve mencioned.

This was just ONE example of how useful will be breadcrumbs (Don’t forget there’s a reason why Vscode highlights the tabs with dirs only when the open files are named the same.)

JonL posted other similar case, and i remember once editing multiple’s script.js (on diferent subfolders obviously) created for others developers.

BTW: I was looking before something like this but didn’t find anything (or maybe i didn’t make a good search, sorry :slight_smile: )

According to apache docs, that’s a valid way (maybe not the most pretty, i already know) because index file is the one, that browsers load by default.

Now, i’m here to learn, so, can anybody explain (in a technically way) why is considered this a bad structure and not some kind of ugly practice?
(Please don’t tell me routes are better)
I’ve read the apache doc and even some examples are with the structure that my client have.

1 Like

No worries. I only wanted to point out that it will soon be 2 years since I opened and that it didn’t seem to get enough community attention to be implemented. Maybe you have more luck with this one.