Jump to content

content selected by domain name


Smirftsch
 Share

Recommended Posts

Hello all!

I am building a page for one of my clients and he wants to restrict content for a specific domain name. The .com has to show all pages and children, but the .de domain is supposed to show only a few pages/children of the .com domain.  It is a multi language page and the ability to switch languages should be kept as well.

Are there any recommendations or even modules how to do such a thing?

I was digging the forums but haven't found anything so far. Perhaps I am just missing the right keywords only ?

Link to comment
Share on other sites

Just add a checkbox to the pages that should be shown (or should not be shown, whatever makes more sense) and exclude/include those pages in all your selectors

$selector = [
  'template' => 'blogpost',
  // and so on
];

if($config->httpHost == 'yourdomain.de') {
  $selector['show_de'] = true;
}

$pages->find($selector);

 

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...