acoustic-terabyte-93857
07/29/2023, 12:50 PMdocker/sdk console twig:cache:warmer . It raise error Template "@HomePage/views/home/home.twig" is not defined.
Any suggest for this issue ?plain-city-95899
07/31/2023, 6:24 AM@HomePage/views/home/home.twig or just home.twigacoustic-terabyte-93857
07/31/2023, 6:34 AMacoustic-terabyte-93857
07/31/2023, 6:36 AMplain-city-95899
07/31/2023, 6:39 AMsrc/Pyz/Yves/HomePage/Theme/<your-theme-name>/views/home/home.twig file. Do you have that file?acoustic-terabyte-93857
07/31/2023, 7:01 AMplain-city-95899
07/31/2023, 7:06 AMsrc/Pyz/Yves/HomePage/Theme/default/views/home/home.twig . just copy it over to your theme folderacoustic-terabyte-93857
07/31/2023, 11:33 AMsrc/Pyz/Yves/HomePage/Theme/green/views/home/home.twig . It no longer gives error home.twig file but it gives error another twig file in another pageplain-city-95899
07/31/2023, 11:34 AMacoustic-terabyte-93857
07/31/2023, 11:44 AMacoustic-terabyte-93857
07/31/2023, 11:47 AMacoustic-terabyte-93857
07/31/2023, 11:49 AMmammoth-ram-1172
07/31/2023, 12:47 PMacoustic-terabyte-93857
07/31/2023, 1:05 PMmammoth-ram-1172
07/31/2023, 1:57 PMacoustic-terabyte-93857
07/31/2023, 11:37 PMacoustic-terabyte-93857
08/01/2023, 10:38 AMmammoth-ram-1172
08/01/2023, 12:26 PMmammoth-ram-1172
08/01/2023, 4:56 PMTwig Cache lesson of the course.
Which shop type and version are you using?acoustic-terabyte-93857
08/02/2023, 10:27 AMacoustic-terabyte-93857
08/02/2023, 10:29 AMmammoth-ram-1172
08/02/2023, 11:35 AMacoustic-terabyte-93857
08/02/2023, 11:46 AMmammoth-ram-1172
08/02/2023, 11:48 AMacoustic-terabyte-93857
08/02/2023, 11:48 AMacoustic-terabyte-93857
08/03/2023, 7:37 AMacoustic-terabyte-93857
08/03/2023, 7:46 AMmammoth-ram-1172
08/03/2023, 8:44 AMmammoth-ram-1172
08/03/2023, 4:48 PMpublic function detailAction(array _$productData_, Request _$request_)
{
_$viewData_ = $this->executeDetailAction(_$productData_, _$request_);
return $this->view(
_$viewData_,
$this->getFactory()->getProductDetailPageWidgetPlugins(),
'@ProductDetailPage/views/pdp/pdp.twig',
);
}
If we copy also the controller folder into ProductDetailDE ( do not forget to change the namespace on top of the controller)
and override the parent’s detail action so as to change the template:
public function detailAction(array _$productData_, Request _$request_)
{
_$viewData_ = $this->executeDetailAction(_$productData_, _$request_);
return $this->view(
_$viewData_,
$this->getFactory()->getProductDetailPageWidgetPlugins(),
'@ProductDetailPageDE/views/pdp/pdp.twig',
);
}
Then the ProductDetailPageDE/views/pdp/pdp.twig is loaded and it doesn’t interfere with the one from the default.
Also the twigcachewarmer builds the template’s array correctly.
It’s hard to trace what changed ever since but with this solution, it works up until the latest version.
If you use the newest one, 202307, then you have to change the getDefaultBucket() in SprykerConfig folder under src, to return the APPLICATION_STORE and add DE and AT to de codebucket array:
return [
‘DE’,
‘EU’,
‘US’,
‘AT’
];
then you have to also customize:
public function getDefaultCodeBucket(): string
{
return _APPLICATION_STORE_;
if ($this->isAcpDevOn()) {
return _APPLICATION_STORE_;
}
_$codeBuckets_ = $this->getCodeBuckets();
return defined('APPLICATION_REGION') ? _APPLICATION_REGION_ : reset(_$codeBuckets_);
}
By default, it’ll return the first code bucket if no _`APPLICATION_REGION`_ is defined.
Code buckets are not bound to stores, so, you’d have to return the APPLICATION_STORE as the default code bucket if you want to use
stores as cod buckets.
The function is deprecated as with multi stores feature, it would be managed in a different wayacoustic-terabyte-93857
08/04/2023, 2:00 AMmammoth-ram-1172
08/04/2023, 8:14 AMacoustic-terabyte-93857
08/04/2023, 8:55 AMmammoth-ram-1172
08/04/2023, 2:53 PMpublic function getDefaultPathCache(_$application_ = _APPLICATION_): string
{
return sprintf(
'%s/src/Generated/%s/Twig/DE/.pathCache',
_APPLICATION_ROOT_DIR_,
ucfirst(strtolower(_$application_)),
);
}
you can see that in the parent method:
public function getDefaultPathCache(_$application_ = _APPLICATION_): string
{
return sprintf(
'%s/src/Generated/%s/Twig/codeBucket/.pathCache',
_APPLICATION_ROOT_DIR_,
ucfirst(strtolower(_$application_)),
);
}
there is the codeBucket part of the path which could be a sign that the intention was to render the path dynamic by using codebucket.
Give it a try! I tried and it works and we don’t have to override the controller’s method.acoustic-terabyte-93857
08/05/2023, 12:03 AM