detect the current page inside component
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!
- mahammadareef
- Posts: 54
- Joined: 14 Oct 2022, 11:54
detect the current page inside component
I just want to hide/show some parts of the catalog/home component if we are inside the home page of aimeos , how to get to know that we are inside aimeos home page in the catalog/home component .
Re: detect the current page inside component
Use the "page-catalog-home" CSS class in the <body> tag to hide/show elements at the home page resp. on other pages.
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
- mahammadareef
- Posts: 54
- Joined: 14 Oct 2022, 11:54
Re: detect the current page inside component
I want to toggle the class 'show' inside one of my component based on the page we are in
I tried this
<body class="{{ $page ?? '' }}">
but the variable $page is not accessible inside the component, its only available in base.blade.php
can u please explain me this step by step ,
Thnk you
I tried this
<body class="{{ $page ?? '' }}">
but the variable $page is not accessible inside the component, its only available in base.blade.php
can u please explain me this step by step ,
Thnk you
Re: detect the current page inside component
You can only toggle by using the CSS, not by any PHP/Blade variables:
Code: Select all
.show { display: none }
.page-catalog-home .show { display: block }
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
- mahammadareef
- Posts: 54
- Joined: 14 Oct 2022, 11:54
Re: detect the current page inside component
yeah, this CSS for toggling HTML I can understand, but my problem is different,
think iam inside the component locale/select which can be available for all the pages, I want to detect my current page inside this component and write the condition as, if this page is home then do this or do that ...
think iam inside the component locale/select which can be available for all the pages, I want to detect my current page inside this component and write the condition as, if this page is home then do this or do that ...
Re: detect the current page inside component
This can't be done inside the component. You would have to add your own HTTP controller classes and in their actions set different configs you can then use inside the component - or create a separate component e.g. for you home page.
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