title: TYPO3 7.6: add code after body tag for Facebook called by a fluid template
body: <p>I insert a fluid template as Content Element somewhere on the page which contains a facebook plugin (<a href="https://developers.facebook.com/docs/plugins/page-plugin?locale=en_US" rel="nofollow noreferrer">developers.facebook.com</a>) ... this plugin requires the SDK to be loaded once right after the opening <code>&lt;body&gt;</code> tag.</p>
  
  <p>I can include the SDK on every page with the following code:</p>
  
  <pre><code>page {
      bodyTagCObject.stdWrap.append = TEXT
      bodyTagCObject.stdWrap.append.value (
  &lt;div id="fb-root"&gt;&lt;/div&gt;
  &lt;script&gt;(function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s); js.id = id;
    js.src = "//connect.facebook.net/en_Us/sdk.js#xfbml=1&amp;version=v2.9";fjs.parentNode.insertBefore(js, fjs);
  }(document, 'script', 'facebook-jssdk'));
  &lt;/script&gt;
      )
  }
  </code></pre>
  
  <p>But I'd like to insert it only when the content element is inserted, maybe with a custom viewhelper, or maybe an existing viewhelper could do the job ...</p>
  
  <p>this is the fluid template (the variable 'facebook' is a constant containg the pertinent url):</p>
  
  <pre><code>&lt;html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
      data-namespace-typo3-fluid="true"&gt;
  
  &lt;div class="fb-page"
   data-href="{facebook}"
   data-tabs="timeline"
   data-small-header="false"
   data-adapt-container-width="true"
   data-hide-cover="false"
   data-show-facepile="true"&gt;
      &lt;blockquote cite="{facebook}" class="fb-xfbml-parse-ignore"&gt;
          &lt;a href="{facebook}"&gt;{facebook}&lt;/a&gt;
      &lt;/blockquote&gt;
  &lt;/div&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I tried if the <code>&lt;f:cObject&gt;</code> viewhelper could fill the value for <code>bodyTagCObject.stdWrap.append</code>, maybe it can but I got nothing working ...</p>