rss yandex except obyavlenie
This commit is contained in:
parent
ffdc7c0a80
commit
2a8ebbbe8e
|
|
@ -82,15 +82,24 @@ class RssFeed extends ComponentBase
|
|||
'title' => 'Source',
|
||||
'description' => 'Source google, yandex',
|
||||
'type' => 'dropdown',
|
||||
'default' => 'google',
|
||||
'default' => 'google',
|
||||
],
|
||||
'exceptCategories' => [
|
||||
'title' => 'rainlab.blog::lang.settings.posts_except_categories',
|
||||
'description' => 'rainlab.blog::lang.settings.posts_except_categories_description',
|
||||
'type' => 'string',
|
||||
'validationPattern' => '^[a-z0-9\-_,\s]+$',
|
||||
'validationMessage' => 'rainlab.blog::lang.settings.posts_except_categories_validation',
|
||||
'default' => '',
|
||||
'group' => 'rainlab.blog::lang.settings.group_exceptions',
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
public function getSourceOptions(){
|
||||
return ['google'=>'google','yandex'=>'yandex'];
|
||||
return ['google'=>'google','yandex'=>'yandex'];
|
||||
}
|
||||
|
||||
|
||||
public function getBlogPageOptions()
|
||||
{
|
||||
return Page::sortBy('baseFileName')->lists('baseFileName', 'baseFileName');
|
||||
|
|
@ -132,7 +141,7 @@ $this->page['language'] = \App::getLocale();
|
|||
$this->page['rssLink'] = $this->currentPageUrl();
|
||||
//Carbon::setLocale('en');
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected function listPosts()
|
||||
|
|
@ -142,10 +151,13 @@ $this->page['language'] = \App::getLocale();
|
|||
/*
|
||||
* List all the posts, eager load their categories
|
||||
*/
|
||||
$posts = BlogPost::with('categories')->listFrontEnd([
|
||||
$posts = BlogPost::listFrontEnd([
|
||||
'sort' => $this->property('sortOrder'),
|
||||
'perPage' => $this->property('postsPerPage'),
|
||||
'category' => $category
|
||||
'category' => $category,
|
||||
'exceptCategories' => is_array($this->property('exceptCategories'))
|
||||
? $this->property('exceptCategories')
|
||||
: preg_split('/,\s*/', $this->property('exceptCategories'), -1, PREG_SPLIT_NO_EMPTY),
|
||||
]);
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -20,4 +20,5 @@ postsPerPage = 20
|
|||
blogPage = "index"
|
||||
postPage = "post"
|
||||
source = "yandex"
|
||||
==
|
||||
exceptCategories = "obyavlenie"
|
||||
==
|
||||
|
|
|
|||
Loading…
Reference in New Issue