저는 주로 Wordpress 사용자이고 Drupal 7의 로프를 배우려고합니다. 제 질문은 템플릿과 모범 사례 및 보안 문제와 관련이 있습니다. 매우 복잡한 디자인 (예, 디자이너 맞습니다!)으로 작업하고 있습니다. 따라서 마크 업은 깨끗하고 정교해야하며, 필자는 Drupal이 템플릿 파일과 함수의 큰 계층 구조로 인해 매우 어려워한다는 것을 발견했습니다. 기본적으로 나에게 맞는 워크 플로우는 노드 레벨에서 실제로 특수화 된 마크 업이 필요한 특정 컨텐츠 유형의 출력을 무시하는 것입니다.Drupal Custom Templating 보안 문제
그래서 예를 들면 : 노드 - 주문 내용 type.tpl.php 내가 워드 프레스 사람이고 데이터베이스 쿼리를 실행할 수있는 사용하고 말했듯이
는 정확한 필드를 잡아 그러나 내가 원하는 값을 사용하고 싶습니다.
$link = $variables['field_link'][0]['url'];
$link_title = $variables['field_link'][0]['title'];
$target = $variables['field_link'][0]['attributes']['target'];
$text = $variables['field_main_text'][0]['safe_value'];
을 그리고 밖으로 echo'ing 내가 원하는만큼 정확하게 마크 업의 변수를 사용하여 : 나는 그것이 포함 된 내용을 공부하고, 그래서 같은 값을 직접 잡아 KPR 또는 $ 변수 배열을 인쇄되었습니다 : 더 중요한 것은 내 보안 위험이며 어떻게 피할 수 있는지 나는이 과정이 모범 사례에 대해 최대 일치하는 방법 궁금
<article class="getstarted-wrapper">
<a id="tocollege" target="<?php print_r($target); ?>" title="<?php print_r($link_title); ?>" href="<?php print_r($link); ?>"><img src="/sites/all/themes/amped/images/visiticon.png" /></a>
<a id="mapcollege" target="_blank" title="View Location In Google Maps" href="<?php echo $maplink; ?>"><img src="/sites/all/themes/amped/images/mapicon.png" /></a>
<div class="getstarted-top" style="background:<?php print_r($bg); ?>;">
<figure>
<img title="<?php print_r($auth_title); ?>" alt="<?php print_r($auth_alt); ?>" src="<?php print_r($auth_img); ?>" />
</figure>
</div><!--getstarted-top-->
<div class="getstarted-bottom">
<p><?php print_r($text); ?></p>
<a target="<?php print_r($target); ?>" title="<?php print_r($link_title); ?>" href="<?php print_r($link); ?>">Get Started</a>
<span>This will take you to <?php print_r($college_name); ?></span>
</div><!--getstarted-bottom-->
</article><!--getstarted-wrapper-->
, 내가 무슨 일을하고, 무엇을 내가 뭐하는 거지를 잘하고?
응답 해 주셔서 감사합니다.이 질문에 대한 답변이없는 유일한 질문은이 워크 플로가 Drupal의 모범 사례와 어떻게 일치하는지에 대한 것입니다. 동일한 작업을 수행하는 더 좋은 방법이 있습니까? –
저는 드루팔 (Drupal)에 익숙하지 않지만 많은 템플릿을 간략하게 살펴보면 XSS에 완전히 취약하다는 것이 업계 표준이라는 것을 알 수있었습니다. :-( – bobince