[Neos] Show the actual URL on the site

Søren Malling soren.malling at gmail.com
Wed Jan 8 10:23:24 CET 2014


In Neos you can use

<neos:uri.node />

and set absolute=TRUE if you want the absolute Uri

Cheers

Søren


On Wed, Jan 8, 2014 at 10:07 AM, 9pm <9pm at gmx.net> wrote:

> Hey!
>
> You're able to create your own ViewHelpers of your site. For that you have
> to create the following structure:
>
> Sites / VENDOR.YourSite / Classes / VENDOR / YourSite / ViewHelpers
>
> In the ViewHelpers folder you create your ViewHelper ... for example:
> GetCurrentUriViewHelper.php
> The content / structure of a ViewHelper should be known and won't be
> mentioned here. The render function contains this few lines:
>
>
>        $uriObject = $this->controllerContext->
> getUriBuilder()->getRequest()->getHttpRequest()->getUri();
>        $uri = $uriObject->getHost() . $uriObject->getPath();
>        return $uri;
>
>
> Now you can access this ViewHelper in your template
> <foo:getCurrentUri />
>
> Of course you first have to set the namespace:
> {namespace foo=VENDOR\YourSite\ViewHelpers}
>
> Maybe you have to grant the access to this ViewHelper in a Policy.yaml...
>
> Greetings
> _______________________________________________
> Neos mailing list
> Neos at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/neos
>


More information about the Neos mailing list