Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added basic templates for live-view of wordpress content, and associa…

…ted getType methods for returning the remote type of the content
  • Loading branch information...
commit ed46ee55f79d92641a220257c4541298f4d5686f 1 parent efe7ac8
Marcus Nyeholt authored
View
3  code/items/WordpressPageContentItem.php
@@ -110,4 +110,7 @@ public function stageChildren() {
return $this->source->getPagesByParentId($this->externalId);
}
+ public function getType() {
+ return 'WpPage';
+ }
}
View
6 code/items/WordpressPostContentItem.php
@@ -26,7 +26,7 @@ public static function factory($source, $data) {
$item->AuthorID = $data['wp_author_id'];
$item->AuthorName = $data['wp_author_display_name'];
$item->Status = $data['post_status'];
- $item->PostFormat = $data['wp_post_format'];
+ $item->PostFormat = isset($data['wp_post_format']) ? $data['wp_post_format'] : '';
if (isset($data['sticky'])) {
$item->Sticky = $data['sticky'];
@@ -119,5 +119,9 @@ public function numChildren() {
public function canImport() {
return class_exists('BlogEntry');
}
+
+ public function getType() {
+ return 'WpPost';
+ }
}
View
10 templates/Layout/ExternalContent_WordpressPageContentItem.ss
@@ -0,0 +1,10 @@
+
+<h2>$Title</h2>
+
+$Description
+
+<% control Children %>
+<p>
+<a href="$Link">$Title</a>
+</p>
+<% end_control %>
View
4 templates/Layout/ExternalContent_WordpressPostContentItem.ss
@@ -0,0 +1,4 @@
+
+<h2>$Title</h2>
+
+$Description
Please sign in to comment.
Something went wrong with that request. Please try again.