Page manager, Panels and theme suggestions Page manager and theme suggestions

I have two types of layout

custom_2col_brick
custom_1col_landing


and I need to render the page according to the selected layout.
basically, I needed two page template for each layout. something like the following:

page__custom_2col_brick.html.twig
page__custom_1col_landing.html.twig


Is there a way to do this?

In Drupal 7 I could do it as follows, but panels_get_current_page_display is not working in Drupal 8

/**
 * Implements hook_preprocess_page().
 *
 * @see page.tpl.php
 */

function THEME_preprocess_page(&amp;$variables) {

    if (module_exists('ctools') &amp;&amp; module_exists('page_manager')) {
        $display = panels_get_current_page_display();
        $layout = (isset($display-&gt;layout)) ? $display-&gt;layout : false;

        /* layout e.g column_one_fluid, column_three_fluid etc. */
        $fluid   =  $layout ? preg_match("/\s*.+_fluid$/", $layout) : false;

        /* layout e.g column_one_landing, column_three_landing_fluid etc. */
        $landing =  $layout ? preg_match("/\s*.+_landing$|\s*.+_landing_fluid$/", $layout) : false;

        $variables['page_fluid'] = ($fluid) ? true : false;
        $variables['page_landing'] = ($landing) ? true : false;

        if($fluid) {
             $variables['theme_hook_suggestions'][] = 'page__fluid';
        }
        if($landing) {
            $variables['theme_hook_suggestions'][] = 'page__landing';
        }

    }
If you don't already have one create a yourtheme.layouts.yml file in your theme folder. There you will define the regions, preview icons, and labels.

custom_2col_brick:
  label: Two Column Brick
  category: My Custom Layouts
  template: layouts/custom_2col_brick
  icon: layouts/custom_2col_brick.png
  regions:
    left:
      label: Left
    right:
      label: Right
    footer:
      label: Footer
custom_1col_landing:
  label: One Column Landing
  category: My Custom Layouts
  template: layouts/custom_1col_landing
  icon: layouts/custom_1col_landing.png
  regions:
    main:
      label: Main Region
    footer:
      label: Footer


Now you can create your page__custom_2col_brick.html.twig and page__custom_1col_landing.html.twig files in your layouts folder. Inside there you can define your template. For example custom_1col_landing.html.twig could contain

&lt;div class="one-column-layout"&gt;
    &lt;div class="row main"&gt;
        {{ content.main }}
    &lt;/div&gt;
    &lt;div class="row expanded one-column-footer"&gt;
        {{ content.footer }}
    &lt;/div&gt;
&lt;/div&gt;


Once finished you should have the following files. (The preview icons are optional)

/yourtheme/yourtheme.layouts.yml
/yourtheme/layouts/custom_2col_brick.html.twig
/yourtheme/layouts/custom_1col_landing.twig