I know the Slider is handled on the site.yaml file, not via the Admin Module:
slider:
- image: slide3.jpg
title: A very delicious blog
url: "#"
- image: slide1.jpg
title: Duis autem
url: "#"
- image: slide2.jpg
title: Pumpkin recipe
url: "#"
I have no problem with translating the pages; Grav documentation helps a lot, but I do not know how to translate the title of each image slide into the second language; only two languages are needed.
Thanks in advance for any Ideas on resolving this sliderās multi-language title.
Regards
joejac
Thank you, @joejac! My answer is just a suggestion, and Iām sure youāll find the right solution. I often treat ready-made templates as inspiration for my own implementations.
Hello q3d text and links work perfectly, but images are not taken from their corresponding subdirectories:
This is because images are taken from the original directory under the theme/images which is not available to the user via the admin panel. src="{{ theme_url }}/images/slideshow/{{ image }}"
Since each image is in a different subdirectory I can not have a common path, is there a way to solve this or place all images inside the same directory available to the admin panel?
It will not be easier to have all titles, images, and URL data for all the slides inside only one default.en.md file, so we can have a default.es.md, too, with all corresponding titles, images, and URL data inside. If I remember well, the Deliver theme has it in this way, but the slider is different, and that implies modifying a lot of the code, which is pretty difficult for me. Sorry.
Ok, solved the images, sorry to get it so slowly, I uploaded all images to the slider directory, and then in user/themes/myinheritedreceptar/templates/partials/slider.html I changed the path to: src=āuser/pages/slider/{{ image }}ā is really easy, thanks q3d
Iām glad I could help! Thereās always room to improve things; I just tried to help get you started. Depending on your needs, the images could, for example, be placed inside subdirectories within the slider folder, with references dynamically fetched in a loop and in the file: user/themes/receptar/templates/partials/slider.html.twig:
{{ set image = page.media.images|first }}
and then insert the image as described in the documentation.
I canāt check or provide a ready solution right now since Iām cooking soup
Great solution, @joejac! Organizing the slider content in the header of each language file is a smart, efficient way to manage multilingual content. I think my approach might have been a bit overcomplicated. Your setup makes it easy to edit everything directly through the Grav Admin panel. Thanks for sharing the details!