Skip to main content
added 23 characters in body
Source Link
DevonDahon
  • 899
  • 2
  • 15
  • 33

You can execute the php-cliphp-cli code below to get a list of all the 186 referenceBlock~200 referenceBlock. Make sure the path to your Magento 2Magento 2 root folder is correct. You can also change the "instruction"instruction variable to list "block"block, "container"container and "referenceContainer"referenceContainer.

<?php

//$instruction = "container";
//$instruction = "referenceContainer";
$instruction = "block";
//$instruction = "referenceBlock";

$path = '/var/www/html/magento2/vendor/magento';
$command = 'cd '.$path.' && egrep -r -i --include \*.xml "<'.$instruction.'".*?"name=" *';
exec($command, $output);

$container_max_length = 1;
$pattern = '/(.*?):.*<'.$instruction.'.*name="(.*?)".*/';
foreach ($output as $subject) {
  preg_match($pattern, $subject, $matches);
  $containers[$matches[2]][] = $matches[1];
  if (strlen($matches[2]) > $container_max_length) $container_max_length = strlen($matches[2]);
}

$n=1;
ksort($containers);
foreach ($containers as $k => $v) {
  printf("%6s", "$n. ");
  printf("%-".$container_max_length."s".$v[0]."\n", $k);
  $i=1;
  while (isset($v[$i])) {
    printf("      %-".$container_max_length."s".$v[$i]."\n", "");
    $i++;
  }
  $n++;
}

?>

You can execute the php-cli code below to get a list of all the 186 referenceBlock. Make sure the path to your Magento 2 is correct. You can also change the "instruction" variable to list "block", "container" and "referenceContainer".

<?php

//$instruction = "container";
//$instruction = "referenceContainer";
$instruction = "block";
//$instruction = "referenceBlock";

$path = '/var/www/html/magento2/vendor/magento';
$command = 'cd '.$path.' && egrep -r -i --include \*.xml "<'.$instruction.'".*?"name=" *';
exec($command, $output);

$container_max_length = 1;
$pattern = '/(.*?):.*<'.$instruction.'.*name="(.*?)".*/';
foreach ($output as $subject) {
  preg_match($pattern, $subject, $matches);
  $containers[$matches[2]][] = $matches[1];
  if (strlen($matches[2]) > $container_max_length) $container_max_length = strlen($matches[2]);
}

$n=1;
ksort($containers);
foreach ($containers as $k => $v) {
  printf("%6s", "$n. ");
  printf("%-".$container_max_length."s".$v[0]."\n", $k);
  $i=1;
  while (isset($v[$i])) {
    printf("      %-".$container_max_length."s".$v[$i]."\n", "");
    $i++;
  }
  $n++;
}

?>

You can execute the php-cli code below to get a list of all the ~200 referenceBlock. Make sure the path to your Magento 2 root folder is correct. You can also change the instruction variable to list block, container and referenceContainer.

<?php

//$instruction = "container";
//$instruction = "referenceContainer";
$instruction = "block";
//$instruction = "referenceBlock";

$path = '/var/www/html/magento2/vendor/magento';
$command = 'cd '.$path.' && egrep -r -i --include \*.xml "<'.$instruction.'".*?"name=" *';
exec($command, $output);

$container_max_length = 1;
$pattern = '/(.*?):.*<'.$instruction.'.*name="(.*?)".*/';
foreach ($output as $subject) {
  preg_match($pattern, $subject, $matches);
  $containers[$matches[2]][] = $matches[1];
  if (strlen($matches[2]) > $container_max_length) $container_max_length = strlen($matches[2]);
}

$n=1;
ksort($containers);
foreach ($containers as $k => $v) {
  printf("%6s", "$n. ");
  printf("%-".$container_max_length."s".$v[0]."\n", $k);
  $i=1;
  while (isset($v[$i])) {
    printf("      %-".$container_max_length."s".$v[$i]."\n", "");
    $i++;
  }
  $n++;
}

?>
added 106 characters in body
Source Link
DevonDahon
  • 899
  • 2
  • 15
  • 33

You can execute the php-cli code below to get a list of all the 186 referenceBlock. Make sure the path to your Magento 2 is correct. You can also change the "instruction" variable to list "block", "container" and "referenceContainer".

<?php

//$instruction = "container";
//$instruction = "referenceContainer";
$instruction = "block";
//$instruction = "referenceBlock";

$path = '/var/www/html/magento2/vendor/magento';
$command = 'cd '.$path.' && egrep -r -i --include \*.xml "<'.$instruction.'".*?"name=" *';
exec($command, $output);

$container_max_length = 1;
$pattern = '/(.*?):.*<'.$instruction.'.*name="(.*?)".*/';
foreach ($output as $subject) {
  preg_match($pattern, $subject, $matches);
  $containers[$matches[2]][] = $matches[1];
  if (strlen($matches[2]) > $container_max_length) $container_max_length = strlen($matches[2]);
}

$n=1;
ksort($containers);
foreach ($containers as $k => $v) {
  printf("%6s", "$n. ");
  printf("%-".$container_max_length."s".$v[0]."\n", $k);
  $i=1;
  while (isset($v[$i])) {
    printf("      %-".$container_max_length."s".$v[$i]."\n", "");
    $i++;
  }
  $n++;
}

?>

You can execute the php-cli code below to get a list of all the 186 referenceBlock. Make sure the path to your Magento 2 is correct. You can also change the "instruction" variable to list "block", "container" and "referenceContainer".

<?php

$instruction = "referenceBlock";

$path = '/var/www/html/magento2/vendor/magento';
$command = 'cd '.$path.' && egrep -r -i --include \*.xml "<'.$instruction.'".*?"name=" *';
exec($command, $output);

$container_max_length = 1;
$pattern = '/(.*?):.*<'.$instruction.'.*name="(.*?)".*/';
foreach ($output as $subject) {
  preg_match($pattern, $subject, $matches);
  $containers[$matches[2]][] = $matches[1];
  if (strlen($matches[2]) > $container_max_length) $container_max_length = strlen($matches[2]);
}

$n=1;
ksort($containers);
foreach ($containers as $k => $v) {
  printf("%6s", "$n. ");
  printf("%-".$container_max_length."s".$v[0]."\n", $k);
  $i=1;
  while (isset($v[$i])) {
    printf("      %-".$container_max_length."s".$v[$i]."\n", "");
    $i++;
  }
  $n++;
}

?>

You can execute the php-cli code below to get a list of all the 186 referenceBlock. Make sure the path to your Magento 2 is correct. You can also change the "instruction" variable to list "block", "container" and "referenceContainer".

<?php

//$instruction = "container";
//$instruction = "referenceContainer";
$instruction = "block";
//$instruction = "referenceBlock";

$path = '/var/www/html/magento2/vendor/magento';
$command = 'cd '.$path.' && egrep -r -i --include \*.xml "<'.$instruction.'".*?"name=" *';
exec($command, $output);

$container_max_length = 1;
$pattern = '/(.*?):.*<'.$instruction.'.*name="(.*?)".*/';
foreach ($output as $subject) {
  preg_match($pattern, $subject, $matches);
  $containers[$matches[2]][] = $matches[1];
  if (strlen($matches[2]) > $container_max_length) $container_max_length = strlen($matches[2]);
}

$n=1;
ksort($containers);
foreach ($containers as $k => $v) {
  printf("%6s", "$n. ");
  printf("%-".$container_max_length."s".$v[0]."\n", $k);
  $i=1;
  while (isset($v[$i])) {
    printf("      %-".$container_max_length."s".$v[$i]."\n", "");
    $i++;
  }
  $n++;
}

?>
Source Link
DevonDahon
  • 899
  • 2
  • 15
  • 33

You can execute the php-cli code below to get a list of all the 186 referenceBlock. Make sure the path to your Magento 2 is correct. You can also change the "instruction" variable to list "block", "container" and "referenceContainer".

<?php

$instruction = "referenceBlock";

$path = '/var/www/html/magento2/vendor/magento';
$command = 'cd '.$path.' && egrep -r -i --include \*.xml "<'.$instruction.'".*?"name=" *';
exec($command, $output);

$container_max_length = 1;
$pattern = '/(.*?):.*<'.$instruction.'.*name="(.*?)".*/';
foreach ($output as $subject) {
  preg_match($pattern, $subject, $matches);
  $containers[$matches[2]][] = $matches[1];
  if (strlen($matches[2]) > $container_max_length) $container_max_length = strlen($matches[2]);
}

$n=1;
ksort($containers);
foreach ($containers as $k => $v) {
  printf("%6s", "$n. ");
  printf("%-".$container_max_length."s".$v[0]."\n", $k);
  $i=1;
  while (isset($v[$i])) {
    printf("      %-".$container_max_length."s".$v[$i]."\n", "");
    $i++;
  }
  $n++;
}

?>