[TYPO3-english] Rookie Q - How / where to add Optimizely snippet?
Jigal van Hemert
jigal.van.hemert at typo3.org
Wed Feb 18 10:21:12 CET 2015
Hi,
On 17/02/2015 18:08, Paul Stevens wrote:
> I am extremely new to Typo3 and I am having trouble with my Optimizely
> snippet.
>
> Could someone point me to a how-to or walk me through how to add the
> snippet to the header?
>
> I tried: Template > Homepage > Setup but I get an error in Optimizely
> that the snippet is not correctly implemented.
Not everybody will know what an "Optimizely snippet" is. Also, please
provide the actual code you added to the TypoScript Setup field.
If it's some JavaScript you need to add to the header of each page this
could be done with:
page.jsInline {
10 = TEXT
10.value (
// Insert JavaScript here without
// the surrounding <script> tags!
)
}
This assumes a few things:
- "page" is the name of the PAGE object
- there is no element "10" yet in page.jsInline
You can check this in the Template module by selecting in the top bar
selectbox "TypoScript Object Browser" and below that after "Browse:"
select "Setup".
More information for ways to include JS/CSS in a page see [1]. On that
page you'll also find methods to include JavaScript/CSS snippets and
files in the header or footer of the page.
Depending on other settings it could be that inline JS is moved to a
file which is included in the head / footer.
[1]
http://docs.typo3.org/typo3cms/TyposcriptReference/Setup/Page/Index.html#setup-page-jsinline
--
Jigal van Hemert
TYPO3 CMS Active Contributor
TYPO3 .... inspiring people to share!
Get involved: typo3.org
More information about the TYPO3-english
mailing list