예제 #1
0
파일: Heading.php 프로젝트: ThePaavero/cms
 public function render($parentId)
 {
     $contents = Content::where('contentTypeSlug', 'heading')->where('parentId', $parentId)->get();
     if ($contents->isEmpty()) {
         return false;
     }
     $contentString = $contents->first()->content;
     $prefix = '<div class="cms-content-wrapper" data-content-type="Heading" data-content-id="' . $contents->first()->id . '">';
     $postfix = '</div>';
     $contentString = $prefix . $contentString . $postfix;
     return $contentString;
 }
예제 #2
0
 public function render($parentId)
 {
     $contents = Content::where('contentTypeSlug', 'textBlock')->where('parentId', $parentId)->get();
     if ($contents->isEmpty()) {
         return false;
     }
     $contentString = $contents->first()->content;
     if ($this->adminMode) {
         $prefix = '<div class="cms-content-wrapper" data-content-type="TextBlock" data-content-id="' . $contents->first()->id . '">';
     } else {
         $prefix = '<div class="cms-content-wrapper text-block">';
     }
     $postfix = '</div>';
     $contentString = $prefix . $contentString . $postfix;
     return $contentString;
 }