Code Monkey home page Code Monkey logo

typo3-pagepath's Introduction

Pagepath extension for TYPO3 CMS

This is an extension for the TYPO3 CMS.

What it does

This extension provides an API for other extensions to create a path to a TYPO3 page for page id and additional URL parameters.

For example the page with id 26 and tx_ttnews[tt_news]=287 can be converted to http://example.com/news/health_care_for_typo3_programmers/.

This is especially helpful in contexts where typolink is not available, for example when creating frontend URLs in a backend module.

How to use

To obtain a URL use the following call:

$pagepath = \Smic\Pagepath\Api::getPagePath($pageId, $parameters);

Page id must be an integer value. Parameters must be an array. The format is the same as for the \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl() function.

The following examples are valid and equivalent:

$parameters = ['tx_ttnews[tt_news]' => 123];
$parameters = ['tx_ttnews' => ['tt_news' => 123]];

The result will be either a fully qualified URL to the page or an \Smic\Pagepath\ApiException is thrown with further information on what went wrong.

Important! If there are many web sites in the page tree, the call should be made within the proper web site.

For example, if there are example1.com and example2.com, and Backend is open at https://example1.com/, resolving will work correctly only for example1.com. To overcome this limitation, make sure you have config.typolinkEnableLinksAcrossDomains=1 in TypoScript setup for all sites.

Caching

Calls to \Smic\Pagepath\Api::getPagePath() are not cached. For an improved performance you can use \Smic\Pagepath\Api::getPagePathCached(), which caches its result internally.

Compatibility

Version 2.x

Developed for TYPO3 8.7

Version 1.1

Developed for TYPO3 7.

Version 1.0

The original code by Dmitry which is compatible with TYPO3 4.5 - 6.2.

Contacts

Maintained by Sebastian Michaelsen [email protected]

Credits to the original developer Dmitry Dulepov [email protected]

typo3-pagepath's People

Contributors

dmitryd avatar kvonspiczak avatar sgalinski avatar smichaelsen avatar superman32432432 avatar

Watchers

 avatar

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.