Unique Main page without CMS

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
TGergo
Posts: 41
Joined: 24 Nov 2022, 14:35

Unique Main page without CMS

Post by TGergo » 31 Jan 2023, 08:33

Aimeos 2022.10.4
PHP version 8.1
Windows 10

Hello!

I would like to create a '/' page.

I tried to create a route and a controller,

Because I have unique contents like News, which it does not support by CMS

class HomeController extends Controller
{
public function indexAction() {
.
...
....
return View::make('mastertheme::home.index', $params);
}

The problem is, i want to use functions, which start like that: $this->
but there is no $this

$this contains many things
this_object.jpg
this_object.jpg (205.44 KiB) Viewed 1508 times
I tried to create $this object by class TestHelper. But the end result is bad.

What is the recommended way?

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

Re: Unique Main page without CMS

Post by aimeos » 01 Feb 2023, 09:29

If you have an Aimeos view, "$this" is always available in the Aimeos template because it's the view object itself. If it's a Blade view, then you don't have any Aimeos view helpers and only the Laravel Blade directives are available.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

TGergo
Posts: 41
Joined: 24 Nov 2022, 14:35

Re: Unique Main page without CMS

Post by TGergo » 02 Feb 2023, 14:50

I think I understood. :)

Main page has a Laravel controller

Code: Select all

class CatalogController extends Controller

		public function homeAction() {
		}
		
}
Main page has a Laravel blade home.blade.php
with this code

Code: Select all

@section('aimeos_body')
	<?= $aibody['catalog/home'] ?? '' ?>
@stop
and in the shop.php

Code: Select all

'page' => [
	'catalog-home' => ['catalog/home', etc. ],
and it calls ...\Catalog\Home\Standard.php like a second controller

and it renders ...\catalog\home\body.php and header.php

And I have to work with them.

Post Reply