public function addItem(Rss $feed, Page $page) { $authors = (array) Helpers::getTags($page, 'Author'); foreach ($authors as &$author) { $author = $author->getName(); } $feed->item(['guid' => $page->url(), 'title' => $page->getTitle(), 'description|cdata' => $page->getDescription(), 'link' => $page->url(), 'pubDate' => $page->getVisibleFrom()->format('r'), 'author|cdata' => empty($authors) ? null : implode(',', $authors)]); }
public function listTags() { $grouped = []; $tags = Helpers::getTags($this->page); foreach ($tags as $t) { $group = $t->getGroup() ?: ''; $grouped[$group][] = $t; } return view('boomcms::editor.page.settings.tags', ['tags' => $grouped]); }
public function addItem(Rss $feed, Page $page) { $tags = Helpers::getTags($page, 'Author'); $authors = []; if (count($tags)) { foreach ($tags as $tag) { $authors[] = $tag->getName(); } } $feed->item(['guid' => $page->url(), 'title' => $page->getTitle(), 'description|cdata' => $page->getDescription(), 'link' => $page->url(), 'pubDate' => $page->getVisibleFrom()->format('r'), 'author|cdata' => empty($authors) ? null : implode(',', $authors)]); }
/** * @param Page $page */ public function view(Site $site, Page $page) { $this->auth($page); $all = TagFacade::findBySite($site); $grouped = []; foreach ($all as $t) { $group = $t->getGroup() ?: ''; $grouped[$group][] = $t; } $tags = Helpers::getTags($page)->map(function (Tag $tag) { return $tag->getId(); }); return view('boomcms::editor.page.settings.tags', ['all' => $grouped, 'tags' => $tags->toArray()]); }