Jump to content

Disable page/url for specific language


synapse
 Share

Recommended Posts

Hello, I'm trying to disable a page for a specific language by unchecking the 'Active?' checkbox but it is still visible by visiting the link and shows up when using the $pages->find() as well.

What am I missing? I followed this guide (https://processwire.com/api/multi-language-support/multi-language-urls/) but it does not seem to be working.

I'm using the latest version 3.0.96

Edit_Page.jpg

 

Edit: after clearing the Page Render cache it stopped showing up in the $pages->find() but the url is still visible

Link to comment
Share on other sites

  • 2 weeks later...
2 hours ago, PWaddict said:

Having a Page Reference field that displays a specific page content on the entire site if I go and uncheck the Active attribute on the additional language I'm still getting the content of the deactivated language.

Here is how I fixed that:

$settings = $pages->get("template=settings");
$language = $user->language;

if($settings->featured_post && $settings->featured_post->viewable($language)) {
  echo "<a href='{$settings->featured_post->url}'>{$settings->featured_post->title}</a>";
}

 

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...