ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Can I use custom fields in the head area of a template?

March 08, 2011 12:44pm

Subscribe [2]
  • #1 / Mar 08, 2011 12:44pm

    temada

    9 posts

    Here’s what I’m trying to accomplish:

    I have around 20 browser-based tools for members of my site to use. Some of the tools require code in the head area, like javascript code. I’d like to set up one template that will allow me to have custom fields both in the head and the body of the document for the various tools. For now, I’ve had to set up a template for each tool, which is a pain.

    Is it possible to use custom fields in the head, and will it accommodate javascript? I tried this:

    {exp:weblog:entries weblog="tools" limit="1"}
    {customcode_head}
    {/exp:weblog:entries}

    but that didn’t work. It displayed the javascript code at the top of the page when viewed in a browser.

    I’m using EE v1.6.8.

  • #2 / Mar 08, 2011 4:59pm

    Sue Crocker

    26054 posts

    Hi, temada.

    One thing you could try is to use Global Variables to store this code in. Might that be an option for you?

    Information on Global variables can be found here in the docs: http://expressionengine.com/legacy_docs/templates/globals/user_defined.html

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases