Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subnavigation on mobiles #1524

Open
gmt-it opened this issue Oct 16, 2024 · 11 comments
Open

Subnavigation on mobiles #1524

gmt-it opened this issue Oct 16, 2024 · 11 comments
Labels

Comments

@gmt-it
Copy link

gmt-it commented Oct 16, 2024

Hello,

I have a small problem. I have set up a subpage with subnavigation on the right. The subnavigation is not displayed on mobile devices. Is this intentional or am I making a mistake here?

Screenshots

subnav_01
subnav_02

@gmt-it
Copy link
Author

gmt-it commented Oct 20, 2024

Nobody here uses the backend layouts with subnavigation? It would be nice if someone tested it and tried it out. Has anyone tried using icons in the subnavigation?

@olivermeckel
Copy link
Contributor

In my opinion, the behavior of the navigation is not an error but expected.

The sub-navigation starts at level 1 (second level), originating from its parent element, and displays two levels. It is hidden in the mobile view, but as a fallback, it is also available in the main navigation. The main navigation starts at level 0 (root level) and displays up to three levels.
This setup ensures access to all pages in the standard configuration.

If I understand correctly, you are also using the meta navigation in the header, right? This is usually created from either a list or a directory and can only display one level. You can display further levels through the page template with sub-navigation, but there is no configuration provided for the mobile view.

You would need to implement this functionality yourself or extend the current configuration.

@gmt-it
Copy link
Author

gmt-it commented Oct 20, 2024

Hello Oliver.

Thanks for your answer. I thought so. I've now used menu_pages. Unfortunately, the icons stored on the pages aren't displayed there. I'm currently looking for the place where the data is passed on in Bootstrap TypoScript.

@olivermeckel
Copy link
Contributor

olivermeckel commented Oct 20, 2024

ok, so menu_pages don't provide the use of icons out of the box.
which bootstrap_package version do you use?

you have to look for something like this in typoscript menu processor:

dataProcessing {
1629202464 = BK2K\BootstrapPackage\DataProcessing\IconsDataProcessor
1629202464 {
iconSet.field = nav_icon_set
iconIdentifier.field = nav_icon_identifier
iconFileFieldName = nav_icon
as = icon
}
}

@gmt-it
Copy link
Author

gmt-it commented Oct 20, 2024

Hello.

I'm using Botstrap package 15 with Typo3 13.4 / 13.2.1. I know about data processing but I can't find the place where this data is passed to MenuPages.html. I'm looking for the Menu definition in setup.typoscript but I'm not at all sure where the DataProcessing has to be inserted and how I can pass the data to MenuPages.html. I still have a lot to learn. :-(

@olivermeckel
Copy link
Contributor

olivermeckel commented Oct 20, 2024

Hi,

yeah, learning is the key! And it will never stop ;-)

Look for the file MenuPages.typoscript in Configuration/TypoScript/ContentElement/Element
But be aware, cause you are switching from menus for pagse to menus in content elements.

Maybe it's better to define an additional page template with your own menu processor …
So you have more control, flexibility and automation

@gmt-it
Copy link
Author

gmt-it commented Oct 20, 2024

Thanks Oliver.

I copied all the typoscripts that I use in my site package from the bootstrap package. I completely forgot that the script files are also needed for the content elements. I have now imported MenuPages.typoscript into my site set and adapted it and also adapted MenuPages.html in my set. The currently active page is shown as active. I just can't see the icons.

I'm missing something.

In the integrated typoscript, I can see that the data processing is integrated. But in the template, {item.icon} is empty. I'm getting grey hair. ;-)

image
MenuPages.typoscript.txt
MenuPages.html.txt

@olivermeckel
Copy link
Contributor

Hi,

the IconsDataProcessor is nested wrong.

MenuPages.typoscript.txt

@gmt-it
Copy link
Author

gmt-it commented Oct 21, 2024

Hello Oliver.

Thank you very much. The clamp cost me a lot of hair and hair dye. ;-)

I still have to learn how to debug. Is there anything you can recommend?

You are now my hero. THANKS AGAIN!

Best regards

Guido
image

@olivermeckel
Copy link
Contributor

Great to hear!

To check the output in templates, e.g. using TypoScript, the Debug Viewhelper <f:debug> is helpful. Place the code <f:debug>{_all}</f:debug> in your template and you will see what data arrives there in the frontend.

For more have a look in the Debbuging Guide from TYPO3:
https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/Debugging/Index.html

@gmt-it
Copy link
Author

gmt-it commented Oct 21, 2024

Thank you very much, Stephan! I'll take a closer look. Hopefully I'll see any missing brackets... ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants