GithubHelp home page GithubHelp logo

typo3-extended-routing's Introduction

#Extended Routing Aspects

What does it do?

Adds some more Mappers for Routing Aspects feature in TYPO3.

How does it work?

With four new Routing aspects you can handle more possibilities for advanced routing in TYPO3.

The mappers

DateTimeMapper

Allows you to create customized url parts including localization to get DateTime values inspeaking parts without using a dataset with defined slug.

Archive:
  type: Extbase
  extension: News
  plugin: Archive
  routes:
    - routePath: '/{day}'
      _controller: 'Archive::list'
      _arguments:
        day: day
  defaultController: 'Archive::list'
  aspects:
    day:
      type: DateTimeMapper
      format: Y-m-d
      localeFormat:
        -
          locale: 'de_.*'
          format: d-m-Y

PersistedSanitizedPatternMapper

Adds a new routing aspect extending the PersistedPatternMapper from TYPO3 core with sanitized URL parts. Localization is respected, if needed.

aspects:
  country:
    type: PersistedSanitizedPatternMapper
    tableName: static_countries
    routeFieldPattern: '^(.*)-(?P<uid>\d+)$'
    routeFieldResult: '{cn_short_de|sanitized}-{uid}'
    localeMap:
      - locale: 'de_*'
        field: cn_short_de
      - locale: 'en_*'
        field: cn_short_en
  territory:
    type: PersistedSanitizedPatternMapper
    tableName: static_territories
    routeFieldPattern: '^(.*)-(?P<uid>\d+)$'
    routeFieldResult: '{tr_name_de|sanitized}-{uid}'
    localeMap:
      - locale: 'de_*'
        field: tr_name_de
      - locale: 'en_*'
        field: tr_name_en

PersistedDisabledAliasMapper

Allows creating full URLs for disabled elements by TCA enablecolumns. Helpful, if you have to create the URLs before publishing the record. Usage as the default PersistedAliaMapper.

News:
  type: Extbase
  extension: News
  plugin: news
  routes:
    -
      routePath: '/{title}'
      _controller: 'News::single'
      _arguments:
        title: news
  aspects:
    title:
      type: PersistedDisabledliasMapper
      tableName: tx_news_domain_model_news
      routeFieldName: path_segment

PersistedNullableAliasMapper

Allows a default value for normally aliased URL path segment. For example, a news without category, but URL part is defined with category.

News:
  type: Extbase
  extension: News
  plugin: News
  routes:
    -
      routePath: '/{category}/{title}'
      _controller: 'News::single'
      _arguments:
        category: category
        title: news
  aspects:
    category:
      type: PersistedNullableAliasMapper
      default: 'no-category'
      tableName: tx_news_domain_model_category
      routeFieldName: path_segment
    title:
      type: PersistedAliasMapper
      tableName: tx_news_domain_model_news
      routeFieldName: path_segment

Installation

Possible via extensions.typo3.org, ZIP upload or composer.

Extension Repository

https://extensions.typo3.org/extension/extended_routing

Composer

composer require calien/extended-routing

typo3-extended-routing's People

Watchers

 avatar  avatar

typo3-extended-routing's Issues

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.