2014-12-30 2 views
0

지금까지 여러 페이지를 테스트 한 결과, <CFHTMLHEAD>을 사용하여 ColdFusion 11의 CFM 페이지에 CSS 또는 JavaScript를 추가하려고 시도 할 때마다 추가되지 않습니다 (CF8에서 올바르게 작동 함).CFHTMLHEAD가 ColdFusion 11에서 작동하지 않는 이유는 무엇입니까?

관리자> 서버 설정> 설정에서 최대 출력 버퍼 크기를 기본값 인 1,024KB에서 늘리지 만 시도한 모든 값 (2048KB, 4096KB 및 최대 999999KB까지)을 읽었습니다.) 나는 동일한 결과를 얻는다 - 내용은 페이지가로드 될 때 <HEAD> 태그에 포함되지 않는다.

누구도이 문제에 뛰어 들어 아직 해결책을 찾지 못했습니까?

코드 샘플 :

htmlhead.cfm :

<cfif NOT ThisTag.HasEndTag> 
    <cfthrow message="Missing end tag for custom tag htmlhead." type="HeadWrap" /> 
</cfif> 

<cfif ThisTag.ExecutionMode is "End"> 
    <cfhtmlhead text="#ThisTag.GeneratedContent#" /> 
    <cfset ThisTag.GeneratedContent = "" /> 
</cfif> 

index.cfm : CF11 아무것도가 전에 오는 cfhtmlhead를 호출을 사용하여 추가 한 내가 찾은

<cfsilent> 
    <!--- 
     Data Retrieval, validation, etc. here 
    ---> 

    <cf_htmlhead> 
     <style type="text/css"> 
      tr.status-RETIRED td { 
       color: #800000; 
      } 

      tr.status-PENDING td { 
       color: #008000; 
      } 
     </style> 
     <script type="text/javascript"> 
     $(function(){ 
      $(".options-menu").mouseleave(function(e){ 
       $(this).hide("fast"); 
      }) 

      $(".options-menu-link").mouseover(function(){ 
       $(".options-menu").hide("fast"); 

       $(".options-menu[data-sku='" + $(this).data("sku") + "']").show("fast"); 
      }).click(function(e){ 
       e.preventDefault(); 
      }); 
     }); 
     </script> 
    </cf_htmlhead> 
</cfsilent> 

<!--- 
    Custom Tag layout.cfm contains the DOCTYPE declaration, html, head (loads jquery, jquery-ui, css, etc.), and body tags with a header and footer for each page. 
---> 
<cf_layout> 
    <!--- Page Content Here (a form, a table, some divs, etc.) ---> 
</cf_layout> 
+3

오류 없음, 단지 결과가 없습니다? Repro case? –

+0

@AdamCameron, 아니요, 오류는 없습니다. 페이지가로드되지만 소스의 HEAD를 보면 CFHTMLHEAD 태그 내에 코딩 된 스크립트 및 스타일 태그가 없어 페이지의 일부가 잘못 표시되거나 올바르게 작동하지 않습니다. –

+1

좋아, 내 질문의 두 번째 (및 * 주 *) 부분 : repro case? IE : 당신이보고있는 것을 보여주는 몇 가지 코드를 제공하십시오. http://sscce.org/ –

답변

3

cfcontent reset = "true"가 결과 문서에 추가되지 않습니다. cf_htmlhead 다음에 호출하는 cf_layout 태그에 내용이 재설정되어 있습니까? 예를 들어

,

<!--- This will not be added under CF11. ---> 
<cfhtmlhead text="<!-- I'm some content that will only be included in CF10 or lower. -->"> 

<cfcontent reset="true"> 

<!--- This will be added under CF11 and lower. ---> 
<cfhtmlhead text="<!-- I'm some content that will be added in CF11 and lower. -->"> 

... the rest of your view code ... 

<!--- This is a sample of the content you will get under CF11 ---> 
<!doctype html> 
<html> 
<head> 
    <meta charset="UTF-8" /> 
    <title>Head Testing</title> 
     <!-- I'm some content that will be added in CF11 and lower. --> 
    </head> 
    <body> 
     <h1>Page content</h1> 
    </body> 
</html> 
관련 문제