Git Product home page Git Product logo

contao-simple-news-urls's Introduction

Contao Simple News URLs

This Contao extension allows news URLs without its reader page fragment. Instead of having an URL like

example.org/reader-page/news-entry

all news entries will instead be reachable via their alias directly, e.g.

example.org/news-entry

when enabled in the respective news archive. There will also be a 301 redirect from the old URL to the new one.

Note: the extension enforces these URLs, i.e. the URL prefix and suffix settings of the website root will be disregarded.

contao-simple-news-urls's People

Contributors

fritzmg avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

contao-simple-news-urls's Issues

search indexing not possible

with the simple news extension in contao 4.5.10, the search indexing is apparently not working.
the search buildup is confused by the 302 status code.

I don't understand why the system recognizes it as a 302, since per default it should be a 301, right?
Weirdly, the http://301re.direct/ recognizes it as a 301.

bildschirmfoto 2018-08-07 um 22 05 45

when alias not unique...

when moving from multiple sites to one (contao)
i received news with the same aliases
((

simple news urls
display only first news
other - 404

for example:
site1.com/newsalias.html (id 1) - works
site2.com/newsalias.html (id 2) - 404

whether it is possible to make something?

ps news have different news archives

Compatibility with Contao 4.7

Hi,

I just wanted to let you know that this package does not work as expected any longer in the new contao 4.7.
News URLs still work fine (www.domain.com/news-123), the matching of the homepage on the other hand is broken (www.domain.com does not resolve to articles with 'index' or '/').

If I remove this package, the routing works fine again.

[2019-02-16 10:24:30] app.DEBUG: Router Symfony\Cmf\Component\Routing\DynamicRouter was not able to match, message "Page alias is empty" [] []
[2019-02-16 10:24:30] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /"" at /Users/xyz/xyz/xyz/vendor/symfony/http-kernel/EventListener/RouterListener.php line 139

Symfony\Component\Routing\Exception\ResourceNotFoundException:
None of the routers in the chain matched this request
GET /app_dev.php HTTP/2.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Encoding: br, gzip, deflate
Accept-Language: de-at
Host: xyz.dev

add possibility to ignore the language fragment for news urls

Currently the language fragment is added to simple news URLs when it is enabled in the system settings. However, since news aliases are unique across all news archives this is not really necessary - thus the "simple news urls" could be made even simpler for this case.

This feature will be added in a major release version, but backwards compatibility with the old behavior could be obtained by adding a system setting like "Add language to simple news URLs".

Umlaute in alias breaks routing -> 404

If there are any german Umlaute in the url, the 404 page is delivered.

After replacing the Umlaute like ä -> ae in the news aliases it works perfectly.

Sitemap doesn't rewrite URL's

Contao 3.5.4
fritzmg/contao-simple-news-urls | 2.0.5

When I'm generating the searchindex, the URL's in the list are not rewritten, so the URL's in the sitemap are not rewritten too.

I think that is causing that my news sites are not indexed automatically by search engines, I always have to manually submit...

Preview broken on news reader pages with suffix manipulation

Getestet in einer frischen 4.9.5: Beim Zusammenspiel mit fehlenden Suffixen gibt es Probleme mit der Preview-Funktion auf Newsreader-Seiten. Wenn ich /app/config/config.yml anlege mit dem Inhalt:

contao: 
   url_suffix: ''

... dann funktioniert auf einer News-Reader-Seite die Preview-Funktion nicht mehr, sondern es wird eine Weiterleitungswarnung ausgegeben (Diese Seite funktioniert nicht ... hat Sie zu oft weitergeleitet. Löschen Sie Ihre Cookies. ERR_TOO_MANY_REDIRECTS)

Der normale Aufruf ohne Preview klappt.

Fatal error by installing on Contao 5.2.7

By installing over the Contao Manager there are two Fatal errors:

Declaration of InspiredMinds\ContaoSimpleNewsUrls\Routing\RouteProvider::getRouteCollectionForRequest() must be compatible with Symfony\Cmf\Component\Routing\RouteProviderInterface::getRouteCollectionForRequest(Symfony\Component\HttpFoundation\Request $request): Symfony\Component\Routing\RouteCollection in C:\UwAmp\www\contao5\vendor\fritzmg\contao-simple-news-urls-bundle\src\Routing\RouteProvider.php on line 38

Declaration of InspiredMinds\ContaoSimpleNewsUrls\Routing\RouteProvider::getRoutesByNames($names): array must be compatible with Symfony\Cmf\Component\Routing\RouteProviderInterface::getRoutesByNames(?array $names = null): Traversable|array in C:\UwAmp\www\contao5\vendor\fritzmg\contao-simple-news-urls-bundle\src\Routing\RouteProvider.php on line 89

I installed it manually and changed the following lines in src/Routing/RouteProvider.php

line 37:

public function getRouteCollectionForRequest(Request $request)
to
public function getRouteCollectionForRequest(Request $request): RouteCollection

line 89:

public function getRoutesByNames($names): array
to
public function getRoutesByNames(?array $names = null): array

But now there is another issue in src/EventListener/RouterGenerateEventListener.php that I can't fix

Symfony\Cmf\Component\Routing\Event\RouterGenerateEvent::setRoute(): Argument #1 ($route) must be of type string, Contao\CoreBundle\Routing\Page\PageRoute given, called in ...\src\EventListener\RouterGenerateEventListener.php on line 70

Apply this to Events?

Any way to apply this same simple URL rewrite to events?
Currently, the event reader is in the event URL same as the news reader was in news URL.
events/event-reader/new-event.html to events/new-event.html

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.