5 Replies Latest reply on Mar 25, 2008 1:40 PM by Oğuz Demirkapı

    Delay execution of CFML

    Is this one taken?
      Hi there

      I manage a site that "pre-generates" pages, so that the execution time is quicker and the demands on the server are reduced when users come to the site.

      The problem is this. I have a template that contains CFML that looks to see the browser that the user is using. When the pages are "pregenerated" using say IE and the user visits using Firefox, the pages to not render properly, because the pregeneration process inserts a reference to the stylesheet for IE, and not Firefox (which makes sense).

      I would simply like to "include" the code that determines which stylesheet should be used in the pregenerated page so that it is executed when the user visists the site, rather than the pregenerated page executing that code when the page is created.

      Is anyone able to assist?

      Thanks for your help in advance.

      Goofy

        • 1. Delay execution of CFML
          BKBK Adobe Community Professional & MVP
          It's not quite clear to me what the problem is. From what I can guess, you could solve the problem by adding code to choose the style in Application.cfm or Application.cfc, thus

          • 2. Re: Delay execution of CFML
            Is this one taken? Level 1
            Thanks very much for your response.

            The problem is, my CF code (similar to that which you have set out below) executes when I pregenerate my page. So, if I were pregenerating the pages using (say) IE7, the line of code "<LINK href="ie7_style.css" rel="stylesheet" type="text/css">" would be inserted into the page, which would then be live on the website. If a person comes along and views the page using Firefox, Opera, IE6 or any other broswer, the IE7 css will be used, because the line <LINK href="ie7_style.css" rel="stylesheet" type="text/css"> is already in the template.

            What I want to do is insert the code (such as yours below) into the template that server executes when the Firefox (or other) user comes to the site.

            Does this assist?

            Regards

            Goofy
            • 3. Re: Delay execution of CFML
              Level 7
              You are simply going to have to modify your pre-generation process so
              that it does not generate this part of your template. Leaving it
              dynamic to be generated at run time.

              Since none of us has any idea how your pre=generation works or how you
              want it to work, it would be very hard to give much more specific advice.

              • 4. Re: Delay execution of CFML
                BKBK Adobe Community Professional & MVP
                You could proceed as follows:

                • 5. Re: Delay execution of CFML
                  Oğuz Demirkapı Level 1
                  If the design based on CSS, there would be a solution also in CSS level.

                  Such as ...

                  <link rel="stylesheet" href="styles.css" />
                  <!--[if lt IE 7]>
                  <link rel="stylesheet" href="ie7.css" />
                  <![endif]-->