# Code einfügen direkt nach dem öffnendem &lt;body&gt; tag

**URL:** <https://forum.shopware.com/t/code-einfugen-direkt-nach-dem-offnendem-lt-body-gt-tag/31681>\
**Category:** Themes & Design\
**Created:** [26. Oktober 2015 um 17:46 UTC](https://forum.shopware.com/t/code-einfugen-direkt-nach-dem-offnendem-lt-body-gt-tag/31681 "2015-10-26T17:46:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![senana](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/senana/32/14169_2.png) [@senana](https://forum.shopware.com/u/senana)\
**Post date:** [26. Oktober 2015 um 17:46 UTC](https://forum.shopware.com/t/code-einfugen-direkt-nach-dem-offnendem-lt-body-gt-tag/31681/1 "2015-10-26T17:46:54Z")

</div>

Hallo Leute, ich möchte gerne wie im Titel ein Schnipsel direkt nach dem öffnenden

tag in die Seite einfügen. Klappt nur leider nicht. Bekomme dann auf der Seite eine “Server error” So bin ich vorgegangen: im file themes/Frontend/Bare/frontend/index/index.tpl habe ich folgenden “Raum” entdeckt ` {block name='frontend\_index\_after\_body'}{/block} 
.... ` Also habe ich gedacht, in den block “frontend\_index\_after\_body” kann ich entspannt mein Schnipsel einfügen. Wenn ich das nun updatesicher machen will erstelle ich eine Datei themes/Frontend/Mein\_custom/frontend/index/index.tpl mit folgendem Inhalt ` {extends file='parent:frontend/index/index.tpl'} {block name='frontend\_index\_after\_body' append} ...hier steht mein Schnipsel... {/block} ` klappt aber leider nicht. Was mache ich falsch? Der Block ist ja im Originaltemplate direkt unter dem öffnenden tag und noch dazu leer! Einer ne Idee?

---

<div class="post-metadata">

**Author:** ![Shopwareianer](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@Shopwareianer](https://forum.shopware.com/u/Shopwareianer)\
**Post date:** [26. Oktober 2015 um 18:02 UTC](https://forum.shopware.com/t/code-einfugen-direkt-nach-dem-offnendem-lt-body-gt-tag/31681/2 "2015-10-26T18:02:50Z")

</div>

Du brauchst kein append. Da der Block eh nichts drin hat: [code] {extends file=‚parent:frontend/index/index.tpl‘} {block name=‚frontend\_index\_after\_body‘}

# test

{/block}[/code] Was für ein Code ist das denn? Ein JS Code?

---

<div class="post-metadata">

**Author:** ![senana](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/senana/32/14169_2.png) [@senana](https://forum.shopware.com/u/senana)\
**Post date:** [26. Oktober 2015 um 18:06 UTC](https://forum.shopware.com/t/code-einfugen-direkt-nach-dem-offnendem-lt-body-gt-tag/31681/3 "2015-10-26T18:06:38Z")

</div>

Jo, das Snippet vom liveperson, das’ ist so ein Tracking- und marketing Dienst. Geht JS da nicht? Gesendet von iPhone mit Tapatalk

---

<div class="post-metadata">

**Author:** ![Shopwareianer](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@Shopwareianer](https://forum.shopware.com/u/Shopwareianer)\
**Post date:** [26. Oktober 2015 um 19:04 UTC](https://forum.shopware.com/t/code-einfugen-direkt-nach-dem-offnendem-lt-body-gt-tag/31681/4 "2015-10-26T19:04:49Z")

</div>

Versuch es mal hiermit: [http://www.smarty.net/docsv2/de/languag … iteral.tpl](http://www.smarty.net/docsv2/de/language.function.literal.tpl)

---

<div class="post-metadata">

**Author:** ![Shopwareianer](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@Shopwareianer](https://forum.shopware.com/u/Shopwareianer)\
**Post date:** [26. Oktober 2015 um 19:10 UTC](https://forum.shopware.com/t/code-einfugen-direkt-nach-dem-offnendem-lt-body-gt-tag/31681/5 "2015-10-26T19:10:12Z")

</div>

Habe es gerade mal selber probiert. Der Block will kurioser weise nicht. Habe hier mal ein Ticket angelegt: [http://jira.shopware.de/?ticket=SW-12980](http://jira.shopware.de/?ticket=SW-12980) Kannst ja mal upvoten 😉 Ansonsten schnapp dir den nächsten Block {block name=“frontend\_index\_no\_script\_message” prepend} damit geht es. Muss es direkt nach dem body sein? Ansonsten würde ich es sowieso in den Footer reinpacken zu den anderen scripts.

---

<div class="post-metadata">

**Author:** ![senana](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/senana/32/14169_2.png) [@senana](https://forum.shopware.com/u/senana)\
**Post date:** [26. Oktober 2015 um 20:24 UTC](https://forum.shopware.com/t/code-einfugen-direkt-nach-dem-offnendem-lt-body-gt-tag/31681/6 "2015-10-26T20:24:33Z")

</div>

[quote=„kayyy“] Kannst ja mal upvoten 😉 [/quote] Done. In der Beschreibung steht „in“ das

tag, möglichst am Anfang. Habs aber aktuell im head drin (Thememanager \> zusätzlicher JS Code) - scheint auch zu klappen. Wenn ich merke dass es nicht richtig läuft, werde ich es mal mit {block name=„frontend\_index\_no\_script\_message“ prepend} versuchen. Glaubst Du das macht einen Unterschied?
