Custom Links in Subparts
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!
Custom Links in Subparts
I have a created a subpart that lists related values. I would like to redirect the user when they click on the list to the item panel I created in a different location. Using the template code there is a link creation function: that generates a link to the parent and not to the subpart.
How would generate a site safe link that takes me to another area in the admin application? Example: the link above generates to this: http://localhost:8000/admin/default/jqadm/get/season/6?locale=en. How would generate it to go here: http://localhost:8000/admin/default/jqadm/get/league/6?locale=en
NOTE: https://aimeos.org/docs/2023.x/infrastr ... view/#link didn't seem to provide any guidance.
Maybe another way to ask... is there an existing method to get the host and site?
Thanks
Code: Select all
$enc->attr( $this->link( 'admin/jqadm/url/get', ['id' => $itemId] + $params ) )
How would generate a site safe link that takes me to another area in the admin application? Example: the link above generates to this: http://localhost:8000/admin/default/jqadm/get/season/6?locale=en. How would generate it to go here: http://localhost:8000/admin/default/jqadm/get/league/6?locale=en
NOTE: https://aimeos.org/docs/2023.x/infrastr ... view/#link didn't seem to provide any guidance.
Maybe another way to ask... is there an existing method to get the host and site?
Thanks
Code: Select all
Php version: 8.2.15
Versions:
aimeos/ai-laravel 2023.10.5
aimeos/aimeos-laravel 2023.10.8
inertiajs/inertia-laravel v0.6.11
laravel/framework v10.48.3
laravel/jetstream v4.3.1
laravel/serializable-closure v1.3.3
spatie/laravel-ignition 2.4.2
Re: Custom Links in Subparts
Use the correct resource parameter and the ID of the subpart as URL fragement:
See: https://aimeos.org/docs/latest/infrastr ... view/#link
Code: Select all
$enc->attr( $this->link( 'admin/jqadm/url/get', ['resource' => 'season', 'id' => $itemId] + $params, [], ['subpart-html-node-id'] ) )
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
Re: Custom Links in Subparts
That worked for what I needed, but how would you link to a subpart using that method? The link that got generated had the subpart ID at the end which didn't seem to work, but I might have missed something in the routing.
Example link created:
http://localhost:8000/admin/jqadm/<panel name>/get/<id>
Wondering how you would get this:
http://localhost:8000/admin/jqadm/<panel name>/<subpanel name>/get/<id>
Example link created:
http://localhost:8000/admin/jqadm/<panel name>/get/<id>
Wondering how you would get this:
http://localhost:8000/admin/jqadm/<panel name>/<subpanel name>/get/<id>
Re: Custom Links in Subparts
Like said, the subpart can be linked to be adding its ID as URL fragment, e.g.:
Code: Select all
<div id="league">...</div>
http://localhost:8000/admin/jqadm/season/get/1#league
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