Skip to content

Commit 006007c

Browse files
committed
Refactor 8672-add-page-pagination-param
1 parent f15efde commit 006007c

File tree

4 files changed

+24
-11
lines changed

4 files changed

+24
-11
lines changed

Block/Post/PostList/AbstractList.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ abstract class AbstractList extends Template implements IdentityInterface
2323
*/
2424
protected $_filterProvider;
2525

26+
/**
2627
/**
2728
* @var \Magento\Cms\Model\Page
2829
*/

Block/Post/PostList/Toolbar/Pager.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88

99
namespace Magefan\Blog\Block\Post\PostList\Toolbar;
1010

11+
use Magento\Store\Model\ScopeInterface;
1112
use Magefan\Blog\Model\Config\Source\LazyLoad;
13+
use Magefan\Blog\Model\Config;
1214

1315
/**
1416
* Blog posts list toolbar pager
@@ -76,7 +78,7 @@ public function getLazyloadMode()
7678
{
7779
return (int) $this->_scopeConfig->getValue(
7880
'mfblog/post_list/lazyload_enabled',
79-
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
81+
ScopeInterface::SCOPE_STORE
8082
);
8183
}
8284

@@ -89,7 +91,7 @@ public function getLazyloadPadding()
8991
{
9092
return (int) $this->_scopeConfig->getValue(
9193
'mfblog/post_list/lazyload_padding',
92-
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
94+
ScopeInterface::SCOPE_STORE
9395
);
9496
}
9597

@@ -100,10 +102,14 @@ public function getLazyloadPadding()
100102
*/
101103
public function getPagePaginationType()
102104
{
103-
return $this->_scopeConfig->getValue(
104-
'mfblog/advanced_permalink/page_pagination_type',
105-
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
106-
);
105+
if ($this->_scopeConfig->getValue(Config::XML_PATH_ADVANCED_PERMALINK_ENABLED, ScopeInterface::SCOPE_STORE)) {
106+
return $this->_scopeConfig->getValue(
107+
Config::XML_PATH_PAGE_PAGINATION_TYPE,
108+
ScopeInterface::SCOPE_STORE
109+
);
110+
}
111+
112+
return 'page';
107113
}
108114

109115
/**

Model/Config.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,13 @@ public function isBlogCssIncludeOnProduct($storeId = null)
279279
*/
280280
public function getPagePaginationType($storeId = null)
281281
{
282-
return $this->getConfig(
283-
self::XML_PATH_PAGE_PAGINATION_TYPE,
284-
$storeId
285-
);
282+
if ($this->getConfig(self::XML_PATH_ADVANCED_PERMALINK_ENABLED, $storeId)) {
283+
return $this->getConfig(
284+
self::XML_PATH_PAGE_PAGINATION_TYPE,
285+
$storeId
286+
);
287+
}
288+
289+
return 'page';
286290
}
287291
}

etc/config.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@
156156
<related_posts_template/>
157157
<number_of_related_posts>5</number_of_related_posts>
158158
</product_page>
159+
<advanced_permalink>
160+
<page_pagination_type>page</page_pagination_type>
161+
</advanced_permalink>
159162
<permalink>
160163
<route>blog</route>
161164
<redirect_to_no_slash>1</redirect_to_no_slash>
@@ -173,7 +176,6 @@
173176
<author_sufix/>
174177
<search_route>search</search_route>
175178
<rss_route>rss</rss_route>
176-
<page_pagination_type>page</page_pagination_type>
177179
</permalink>
178180
<seo>
179181
<use_canonical_meta_tag_for>all</use_canonical_meta_tag_for>

0 commit comments

Comments
 (0)