news category filtering issue in exended class Contao
up vote
0
down vote
favorite
I registered $GLOBALS['TL_HOOKS']['newsListFetchItems'] hook in my news extended extension for sorting with my custom field (say 'rank'). But the pages which contain news filtering is not working . I am using the contao Version 4.5.8 . How can I solve the issue.
$t = NewsModel::getTable();
$arrOptions = array();
switch ($objModule->news_sorting)
{
case 'sort_rankid_asc':
$arrOptions['order'] = "$t.rankid = 0, $t.rankid, $t.date DESC";
break;
case 'sort_random':
$arrOptions['order'] = "$t.date DESC";
break;
default:
$arrOptions['order'] = "$t.date DESC";
}
return NewsModel::findPublishedByPids($newsArchives, $blnFeatured, $limit, $offset, $arrOptions);
News filtering with category is not working after I added the above code.How Can I fix the issue
content-management-system contao
add a comment |
up vote
0
down vote
favorite
I registered $GLOBALS['TL_HOOKS']['newsListFetchItems'] hook in my news extended extension for sorting with my custom field (say 'rank'). But the pages which contain news filtering is not working . I am using the contao Version 4.5.8 . How can I solve the issue.
$t = NewsModel::getTable();
$arrOptions = array();
switch ($objModule->news_sorting)
{
case 'sort_rankid_asc':
$arrOptions['order'] = "$t.rankid = 0, $t.rankid, $t.date DESC";
break;
case 'sort_random':
$arrOptions['order'] = "$t.date DESC";
break;
default:
$arrOptions['order'] = "$t.date DESC";
}
return NewsModel::findPublishedByPids($newsArchives, $blnFeatured, $limit, $offset, $arrOptions);
News filtering with category is not working after I added the above code.How Can I fix the issue
content-management-system contao
Your title mentions "news category filtering", but your description does not mention any of that. Did you enable any news category features in your news list module? If yes, then please provide a more detailed description.
– fritzmg
Nov 8 at 13:52
I have news category filtering option in my news listing page. After adding the above hook the filtering is not working. I updated my question also
– Aswathy S
Nov 9 at 3:55
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I registered $GLOBALS['TL_HOOKS']['newsListFetchItems'] hook in my news extended extension for sorting with my custom field (say 'rank'). But the pages which contain news filtering is not working . I am using the contao Version 4.5.8 . How can I solve the issue.
$t = NewsModel::getTable();
$arrOptions = array();
switch ($objModule->news_sorting)
{
case 'sort_rankid_asc':
$arrOptions['order'] = "$t.rankid = 0, $t.rankid, $t.date DESC";
break;
case 'sort_random':
$arrOptions['order'] = "$t.date DESC";
break;
default:
$arrOptions['order'] = "$t.date DESC";
}
return NewsModel::findPublishedByPids($newsArchives, $blnFeatured, $limit, $offset, $arrOptions);
News filtering with category is not working after I added the above code.How Can I fix the issue
content-management-system contao
I registered $GLOBALS['TL_HOOKS']['newsListFetchItems'] hook in my news extended extension for sorting with my custom field (say 'rank'). But the pages which contain news filtering is not working . I am using the contao Version 4.5.8 . How can I solve the issue.
$t = NewsModel::getTable();
$arrOptions = array();
switch ($objModule->news_sorting)
{
case 'sort_rankid_asc':
$arrOptions['order'] = "$t.rankid = 0, $t.rankid, $t.date DESC";
break;
case 'sort_random':
$arrOptions['order'] = "$t.date DESC";
break;
default:
$arrOptions['order'] = "$t.date DESC";
}
return NewsModel::findPublishedByPids($newsArchives, $blnFeatured, $limit, $offset, $arrOptions);
News filtering with category is not working after I added the above code.How Can I fix the issue
content-management-system contao
content-management-system contao
edited Nov 9 at 3:53
asked Nov 8 at 11:25
Aswathy S
559624
559624
Your title mentions "news category filtering", but your description does not mention any of that. Did you enable any news category features in your news list module? If yes, then please provide a more detailed description.
– fritzmg
Nov 8 at 13:52
I have news category filtering option in my news listing page. After adding the above hook the filtering is not working. I updated my question also
– Aswathy S
Nov 9 at 3:55
add a comment |
Your title mentions "news category filtering", but your description does not mention any of that. Did you enable any news category features in your news list module? If yes, then please provide a more detailed description.
– fritzmg
Nov 8 at 13:52
I have news category filtering option in my news listing page. After adding the above hook the filtering is not working. I updated my question also
– Aswathy S
Nov 9 at 3:55
Your title mentions "news category filtering", but your description does not mention any of that. Did you enable any news category features in your news list module? If yes, then please provide a more detailed description.
– fritzmg
Nov 8 at 13:52
Your title mentions "news category filtering", but your description does not mention any of that. Did you enable any news category features in your news list module? If yes, then please provide a more detailed description.
– fritzmg
Nov 8 at 13:52
I have news category filtering option in my news listing page. After adding the above hook the filtering is not working. I updated my question also
– Aswathy S
Nov 9 at 3:55
I have news category filtering option in my news listing page. After adding the above hook the filtering is not working. I updated my question also
– Aswathy S
Nov 9 at 3:55
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
The codefog/contao-news_categories extension in version 3.x also uses the newsListFetchItems hook to filter the news list items (see here). The hook will only work for one extension - which ever one returns something other than false first.
If you need both your custom sorting and filtering by a category, then you will need to implement the news category filtering yourself and you have to make sure that your hook is executed first.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
The codefog/contao-news_categories extension in version 3.x also uses the newsListFetchItems hook to filter the news list items (see here). The hook will only work for one extension - which ever one returns something other than false first.
If you need both your custom sorting and filtering by a category, then you will need to implement the news category filtering yourself and you have to make sure that your hook is executed first.
add a comment |
up vote
1
down vote
accepted
The codefog/contao-news_categories extension in version 3.x also uses the newsListFetchItems hook to filter the news list items (see here). The hook will only work for one extension - which ever one returns something other than false first.
If you need both your custom sorting and filtering by a category, then you will need to implement the news category filtering yourself and you have to make sure that your hook is executed first.
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
The codefog/contao-news_categories extension in version 3.x also uses the newsListFetchItems hook to filter the news list items (see here). The hook will only work for one extension - which ever one returns something other than false first.
If you need both your custom sorting and filtering by a category, then you will need to implement the news category filtering yourself and you have to make sure that your hook is executed first.
The codefog/contao-news_categories extension in version 3.x also uses the newsListFetchItems hook to filter the news list items (see here). The hook will only work for one extension - which ever one returns something other than false first.
If you need both your custom sorting and filtering by a category, then you will need to implement the news category filtering yourself and you have to make sure that your hook is executed first.
answered Nov 9 at 9:35
fritzmg
1,2671930
1,2671930
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53206793%2fnews-category-filtering-issue-in-exended-class-contao%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Your title mentions "news category filtering", but your description does not mention any of that. Did you enable any news category features in your news list module? If yes, then please provide a more detailed description.
– fritzmg
Nov 8 at 13:52
I have news category filtering option in my news listing page. After adding the above hook the filtering is not working. I updated my question also
– Aswathy S
Nov 9 at 3:55