Several theme loading views problem

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
krzysiekp
Posts: 74
Joined: 05 Nov 2021, 16:19

Re: Several theme loading views problem

Post by krzysiekp » 19 May 2022, 10:46

If you switch sites with different themes, is the theme name in the file path still the same?
Yes
Can you dump "$this->paths" here and check what the array contains when you switch sites with different themes?
The same is displayed in both cases:

Code: Select all

array:4 [▼
array:4 [▼
  "C:\xampp\htdocs\giftcard\vendor\aimeos\ai-client-html" => array:1 [▼
    0 => "client/html/templates"
  ]
  "C:\xampp\htdocs\giftcard\vendor\aimeos-extensions\new-ext" => array:1 [▼
    0 => "client/html/templates"
  ]
  "C:\xampp\htdocs\giftcard\vendor\aimeos-themes\pl-theme" => array:1 [▼
    0 => "client/html/templates"
  ]
  "C:\xampp\htdocs\giftcard\vendor\aimeos-themes\sk-theme" => array:1 [▼
    0 => "client/html/templates"
  ]
]
]

User avatar
aimeos
Administrator
Posts: 6197
Joined: 01 Jan 1970, 00:00

Re: Several theme loading views problem

Post by aimeos » 19 May 2022, 12:34

Maybe we've found the problem. Can you please open the "manifest.php" files of your theme extensions. They contains this section:

Code: Select all

	'template' => [
		'admin/jqadm/templates' => [
			'admin/jqadm/templates',
		],
		'admin/jsonadm/templates' => [
			'admin/jsonadm/templates',
		],
		'client/html/templates' => [
			'client/html/templates',
		],
		'client/jsonapi/templates' => [
			'client/jsonapi/templates',
		],
		'controller/jobs/templates' => [
			'controller/jobs/templates',
			'client/html/templates',
		],
	],
Replace this in all your theme extensions with:

Code: Select all

	'template' => [
		'<theme-name>' => [
	 		'admin/jqadm/templates' => [
				'admin/jqadm/templates',
			],
			'admin/jsonadm/templates' => [
				'admin/jsonadm/templates',
			],
			'client/html/templates' => [
				'client/html/templates',
			],
			'client/jsonapi/templates' => [
				'client/jsonapi/templates',
			],
			'controller/jobs/templates' => [
				'controller/jobs/templates',
				'client/html/templates',
			],
		],
	],
where "<theme-name>" must be replaced with the name of your theme extension ("pl-theme" and "sk-theme" in your case).
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

cyberdev
Posts: 13
Joined: 06 May 2022, 09:10

Re: Several theme loading views problem

Post by cyberdev » 19 May 2022, 14:09

The correct config will be...

'template' => [
'themename' => [
'admin/jqadm/templates' => [
'templates/admin/jqadm',
],
'admin/jsonadm/templates' => [
'templates/admin/jsonadm',
],
'client/jsonapi/templates' => [
'templates/client/jsonapi',
],
'client/html/templates' => [
'templates/client/html',
],
'controller/jobs/templates' => [
'templates/controller/jobs',
],
],

krzysiekp
Posts: 74
Joined: 05 Nov 2021, 16:19

Re: Several theme loading views problem

Post by krzysiekp » 19 May 2022, 14:52

It works, but I wonder if I should rewrite it on my own controllers to have more control over it

User avatar
aimeos
Administrator
Posts: 6197
Joined: 01 Jan 1970, 00:00

Re: Several theme loading views problem

Post by aimeos » 19 May 2022, 15:34

If it works, you don't need your own controllers and you can save that work.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

krzysiekp
Posts: 74
Joined: 05 Nov 2021, 16:19

Re: Several theme loading views problem

Post by krzysiekp » 19 May 2022, 19:32

I will expand this shop to different countries. Each country may have different validation of customer data and for different payment methods. Aimeos has the limitation that you cannot redirect to a page, but display an indirect page with a click link. It may also have restrictions on validation etc.
I do not have many products, because only 3 for each store. If I rewrite it for my controllers, it may be a more custom solution. I am afraid that at some point I will not be able to deal with something and there will be a problem.

User avatar
aimeos
Administrator
Posts: 6197
Joined: 01 Jan 1970, 00:00

Re: Several theme loading views problem

Post by aimeos » 20 May 2022, 09:16

You are not bound to the standard Aimeos setup and configuration. Instead, you can change everything you need, e.g. send a redirect for the payment directly if you don't need that step.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply