Fluid view helper for redirection

Hi,
Is there a fluid-view- or fusion-helper, which can use for redirect or render a different page-node completely, instead of current?

At least two page-types I would like to redirect/render with different page-content for browser-request, instead of show an 404 or cryptical output.

A. Navigation-elements without page or shortcut (if user delete the www,website.com/navElement/ targetWebsite.html Ending)
A. Backend-manageable data-records (if editor would chose it instead of an real pageNode)

Shortcut-page-nodeType doesn’t fit.

They need different processing in backend. (show (A) a field to edit the data-record or (B) information for editor. In backend all works fine). In Frontend they have to show a definable «Insteadof-page».


###Desirable solution

Would be great if I could use a fluid Template within a switch like this:

namespace neos=TYPO3\Neos\ViewHelpers}
<f:if condition="{neos:rendering.inBackend()}">
    <f:then>
        {content -> f:format.raw()}
    </f:then>
    <f:else>
        {f:redirect(node:redirection)}
    </f:else>
</f:if>

For particular site-nodeType I would define an own NodeType-Attribute «redirection».


###Question:

I’m quite sure there is somewhere a usable helper or feasible alternative with fusion, …
But I can’t find the documentation-entry.

Does anyone know a suitable view-/fusion-helper/ or a solution?

Hey Martin,

the way to go would be fusion/ts2. Basically you set the http-status-code and a location header for the response.

The page fusion object: http://neos.readthedocs.io/en/stable/References/NeosTypoScriptReference.html#page

Which is an extending the http-message-object: http://neos.readthedocs.io/en/stable/References/NeosTypoScriptReference.html#typo3-typoscript-http-message

That has a http-responsehead object: http://neos.readthedocs.io/en/stable/References/NeosTypoScriptReference.html#typo3-typoscript-http-responsehead

The last one is the one you want to play with.

Regards, Martin

Hi @mficzel,
thank you for the links seems to be perfect. Will share working code, as soon as I wrote it.