J3.x

J3.x:Novo Sistema de Roteamento de URLs

From Joomla! Documentation

Revision as of 20:47, 28 September 2017 by Anabarcellos (talk | contribs) (Created page with "Roteador existente:")
Tutorial
O novo sistema de roteamento de URLs
Joomla! 
3.8

Introdução

O novo sistema de roteamento define uma interface nova e mais flexível para que os desenvolvedores gerenciem a criação e processamento de URLs, oferecendo aos usuários finais mais opções para exibição das URLs (incluindo a possibilidade muito solicitada de remover os IDs dos itens de conteúdo da URL).
A partir do Joomla! 3.8, para os componentes que suportam o novo roteador (Conteúdo, Contatos, Usuários e Newsfeeds), é possível configurar o roteador para executar em uma das três configurações a seguir:

  • Sistema de roteamento atual (Permanece como comportamento padrão para novas instalações. É a opção que geralmente será recomendada na atualização de sites já existentes)
  • Novo sistema de roteamento
  • Novo sistema de roteamento sem IDs de item de conteúdo

Notas

Como as URLs geradas com o novo sistema de roteamento não são 100% compatíveis com o roteador atual, sugere-se que os sites existentes não habilitem o novo sistema sem testar completamente em ambiente de teste e checar todas as alterações de URL. < br /> Incentivamos que novos sites usem o novo sistema imediatamente.

Quais são as mudanças nas URLs?

Quando as opções de SEF estão ativadas, temos as seguintes opções de configurações de roteamento:

  • Página da categoria de animais na galeria de fotos:
    • Roteador existente: /article-categories/72-park-site/photo-gallery/animals
    • Novo roteador habilitado com IDs: /article-categories/26-park-site/28-photo-gallery/72-animals
    • Novo roteador habilitado sem IDs: /article-categories/park-site/photo-gallery/animals
  • Página do artigo Koala
    • Roteador existente: /article-categories/72-park-site/photo-gallery/animals/25-koala
    • New router enabled with IDs: /article-categories/26-park-site/28-photo-gallery/72-animals/25-koala
    • New router enabled without IDs: /article-categories/park-site/photo-gallery/animals/koala

The numbers indicate the IDs of your categories and articles.
With the new router and the Remove IDs option enabled, the IDs are removed, which allow to have cleaner and more friendly URLs. It will also improve your SEO.

How can I enable the new routing system?

Enable the new router
Enable the new router

The New Routing System is available for Content, Contacts, Users, and Newsfeeds. The way to enable this new features is the same for each of them.

Let's take Content as example.

  • Log in the backend
  • In the top menu, navigate to Content  Articles
  • Click on the button Options at the top right
  • Click on the Integration tab
  • Activate the New Routing System:
    • Click on Experimental to enable the new URL Routing
    • Click on Yes if you want to remove IDs.
  • Click on Save or Save & Close at the top left
  • Visit your frontend and check your URLs.

Follow the same process for Contacts, Users, and Newsfeeds.

NB: There are cases where changing the routing system can change a page’s URL and cause an existing page to give a 404 response. Developers are still discussing ideas for a migration plan to keep old URLs working to some extent.