How to make a path of the pages accessed on a website

Asked

Viewed 379 times

0

inserir a descrição da imagem aqui

Hi, I’m looking, but I can’t find anything on Google. I want to put a "path" like the photo on my site, I imagine it is simple, but I do not know how to do, if someone knows or has a link, I will be grateful.

Note: if you need to use programming language, if you have it in JSP it is better.

  • Confer https://www.w3schools.com/howto/howto_css_breadcrumbs.asp

  • Here’s a collection of CSS examples https://freefrontend.com/css-breadcrumbs/

  • This kind of thing is called "Readcrumbs" (I’ve heard of "bread crumbs", which is the literal translation of the thing). The concept is as if you left bread crumbs to know the way back. The top colleagues have already posted links for you to know, but if you want to search more on Google, just play these keywords that will be full of information. I never made one to give you step by step.

2 answers

0

It is possible to do this in an easier way if you have a static website.

In php:

$URL_ATUAL= "$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";  // aqui tu recupera a url 
$caminho = "";                                           // declara a variável que vai ser usada no laço
$URL_ATUAL = explode('/', $URL_ATUAL);                   // explode a url e cria um array
for ($i=1; $i < count($URL_ATUAL); $i++) {               // cria um laço de repetição iniciando em 1 para não contar o domínio
    if ($i == count($URL_ATUAL) - 1) {                   // verifica se é o último item do array, se for verdadeiro executa o bloco abaixo, caso contrário ignora e vai para o próximo bloco.
        $caminho .= ucfirst($URL_ATUAL[$i]);             // caso for não inclui a ">" no fim e também coloca a primeira letra em maiúsculo
    } else {
        $caminho .= ucfirst($URL_ATUAL[$i])." > ";       // para cada item do array concatena na variável caminho. 
    }   
}

This is the php part after where you want to use just give one <?php echo $caminho ?> in html code.

0

These paths are nothing more than links that redirect to specific pages using only HTML is possible to build them, including changing their style using CSS normally.

  1. Below is a link from w3schools showing how it looks in HTML:

    https://www.w3schools.com/howto/howto_css_breadcrumbs.asp


  1. If you are using bootstrap to build the layout you can use:

    https://getbootstrap.com/docs/4.3/components/breadcrumb/


If you need the pages to save and upload information to each other, review their rules for each redirect, preventing data from being duplicated, deleted, etc.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.