tjameeli
tjameeli

Reputation: 47

TYPO3 Preview URL Configuration

Struggling to implement an additional query string to the preview URL

Found documentation here: https://docs.typo3.org/typo3cms/extensions/core/Changelog/7.2/Feature-66370-AddFlexiblePreviewUrlConfiguration.html

But I can't implement it.

To clarify, I want to add a new query string when previewing a page (specifically a custom page type, but adding a query string for all pages would be a good start!)

I've tried adding this

page = PAGE
page {
    TCEMAIN.preview {
        pages {
            additionalGetParameters {
                newQueryString = property1
            }
        }
    }
}

but no joy - please help!

Upvotes: 1

Views: 396

Answers (1)

David
David

Reputation: 6084

In your code you're mixing TypoScript-setup for the template-record with the syntax for PageTS in the page-properties.
TCEMAIN is usually used in PageTS or UserTS and is not available in TypoScript-setup for templates.
So you just have to use the following code in the TS field of the page-properties of the root-page:

TCEMAIN.preview {
    pages {
        additionalGetParameters {
            newQueryString = tx_ngkpagetypes_sitesettings_languageversion
        }
    }
}

Upvotes: 1

Related Questions