Pop-up menus in Templates

Posted on 2005-04-27
Last Modified: 2013-11-28
On 10/30/2002, a question was asked about why pop-up menus couldn't be added to templates.
The answer was because pop-ups are stored in the head section of a document, and templates lock the head section.

But at this PAQ
someone mentioned that they "export the javascript to another file and call (link) it in my template page".

Q: How do you call (link) javascript code to a template?
Is is done with a cfinclude?
I'd like to add a pop-up menu to my template.

Question by:psenn
    LVL 8

    Expert Comment

    To link a js file (external javascript file) you call it like a css file.

    In the <head> tag place this;
    <script type="text/javascript" src="myjavascript.js"></script>

    You can also link the file with an include statement...
    <cfinclude template=myjavascript.js>

    I'm unsure on wether or not there are quotes in the cf tag.  It's been a long time since I've used cf.  Also you might have to put the javascript in <script> tags and embed them in another cfm file.  Not sure about that.

    Author Comment


    Thanks for the reply.  I've been experimenting with CSS flyouts such as "Deluxe CSS dropdowns and flyouts" found at
    so I might not use the "Show pop-up menu" feature that's built into DW.

    Here's some other links:

    I haven't gotten it quite down yet.
    The problem with CSS flyouts is they require a bit of tweeking to get them to work ( is required for IE browser to work).

    What am I missing?  All I want to do is put a pop-out (dropdown, flyout) menu on my template (*.dwt file).
    If you wanted to put a pop-out menu on your website, how would you do it?
    LVL 8

    Accepted Solution

    I'd do it in javascript and css.

    Author Comment

    Here's how I did it using javascript and css:
    Take a look and tell me what you think.

    The only problem is I had to include the following to get it to work:
    <!--[if IE]>
          <style type="text/css">
            body {behavior: url(;}
    I guess I don't have much to complain about since it works, but I'm just looking for the cleanest implementation of css pop-out menus, and I'm not too keen on including

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Suggested Solutions

    Title # Comments Views Activity
    Critique my logo artwork? 31 78
    Video Not Showing 8 87
    Opening .cgi Files in DreawWeaver cc 2015 6 94
    Repatha drug prices 2 68
    The number of job posts appearing for social media managers is clearly on the rise which can only be good for the unemployment figures. For business owners however this posting may be brought about by a  number of factors, none of which are good bus…
    Every business owner understands the significance of online customer reviews and the impact it can have on sales and revenues. With technology advancing at such a rapid pace, getting online reviews has never been easier, especially when many regions…
    Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
    Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now