Skip to content

Two different output categories (how to avoid duplicates) #51

Closed Answered by mjauvin
oim37 asked this question in Q&A
Discussion options

You must be logged in to vote

I don't think there is a setting to avoid this, but you could apply some logic to the onEnd() method of each page to avoid showing a post from each other (and maybe redirect to the other page)

function onEnd()
{
    $category = $this->post->categories->first();
    // if ($category && $category->id === 2) {
    if ($category && $category->name === 'news') {
        Return Redirect::to(...);
    }
}

Replies: 11 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by oim37
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@mjauvin
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #50 on September 20, 2023 13:59.