How to display the content of the CMS page
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!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
- ahmed31916
- Advanced
- Posts: 148
- Joined: 14 Apr 2022, 12:15
How to display the content of the CMS page
Hello,
I made a new cms page for "about us" page. I added this to the web.php:
and in "AboutUsController@index":
and in "page.aboutus" :
and in config/shop.php:
Now, when I add a new cms content in admin panel for this route "/aboutus", the content doesn't appear in "page.aboutus" page. Why?
I made a new cms page for "about us" page. I added this to the web.php:
Code: Select all
Route::group(['prefix' => '{site}', 'middleware' => ['web']], function () {
Route::match(['GET', 'POST'], '{path?}', 'App\Http\Controllers\AboutUsController@index')
->name('about_us')->where( 'path', '.*' )->where( ['site' => '[a-z0-9\-]+'] );
});
Code: Select all
public function index()
{
return View::make( Shop::template( 'page.aboutus' ), ['page' => 'page-aboutus'] );
}
Code: Select all
<?= $aibody['cms/page'] ?? '' ?>
Code: Select all
'page' => ['page-aboutus' => ['cms/page'],]
Re: How to display the content of the CMS page
Your index() method is wrongly implemented. Have a look here:
https://github.com/aimeos/aimeos-larave ... hp#L32-L44
https://github.com/aimeos/aimeos-larave ... hp#L32-L44
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
- ahmed31916
- Advanced
- Posts: 148
- Joined: 14 Apr 2022, 12:15
Re: How to display the content of the CMS page
Thank you, but why I should to pass a "?path=" parameter?
Can I overwrite the Standard class for the CMS, in my extension? (I asked this question because the CMS code and template inside grapesjs package).
Can I overwrite the Standard class for the CMS, in my extension? (I asked this question because the CMS code and template inside grapesjs package).
Re: How to display the content of the CMS page
If you've install the CMS extension, you can already create pages with a custom URL segment (path). The latest Aimeos package already contains working code so there's no need to create an own controller for content pages:
- https://github.com/aimeos/aimeos-larave ... #L270-L279
- https://github.com/aimeos/aimeos/blob/m ... op.php#L40
- https://github.com/aimeos/aimeos-larave ... hp#L84-L86
- https://github.com/aimeos/aimeos-larave ... #L270-L279
- https://github.com/aimeos/aimeos/blob/m ... op.php#L40
- https://github.com/aimeos/aimeos-larave ... hp#L84-L86
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star