5.6.x override custom block in mobile theme
Permalink
Hi guys,
I have custom theme ( in themes folder ), and custom template for autonav block. I have added new theme for mobile devices ( also just placed it in themes folder ). It is working, but here is problem what I am facing:
I need to have different template of already customised autonav block just for mobile theme.
I found some solutions mentioning packaged themes, but mine isn't packaged.
I tried adding block template folder in /themes/mobile/blocks/autonav/templates/same_name but it didn't work even after clear cache, theme inspect...
Could someone help with advice how to proceed.
I have custom theme ( in themes folder ), and custom template for autonav block. I have added new theme for mobile devices ( also just placed it in themes folder ). It is working, but here is problem what I am facing:
I need to have different template of already customised autonav block just for mobile theme.
I found some solutions mentioning packaged themes, but mine isn't packaged.
I tried adding block template folder in /themes/mobile/blocks/autonav/templates/same_name but it didn't work even after clear cache, theme inspect...
Could someone help with advice how to proceed.
I dont have 56 installed right now but there is a place on the themes page to set your mobile theme as different from the desktop theme. If you have 2 different themes it should be no problem changing what is displayed.
tallacman thanks for reply,
I don't have problem with mobile theme switcher - that works.
Here's my problem:
1) I have theme A which uses customized autonav block ( /blocks/autonav/templates/myNav )
2) I need to present that autonav differently when mobile theme B is selected ( on mobile devices ) without need to change content.
I cannot do new template for autonav as I don't know how to switch them depending on theme installed.
I tried adding blocks directory in mobile theme folder with autonav/templates/myNav and different code there, but that doesn't work
I hope I am more clear now.
I don't have problem with mobile theme switcher - that works.
Here's my problem:
1) I have theme A which uses customized autonav block ( /blocks/autonav/templates/myNav )
2) I need to present that autonav differently when mobile theme B is selected ( on mobile devices ) without need to change content.
I cannot do new template for autonav as I don't know how to switch them depending on theme installed.
I tried adding blocks directory in mobile theme folder with autonav/templates/myNav and different code there, but that doesn't work
I hope I am more clear now.
I've been meaning to add mobile and tablet detection to my genetic stacks add-on for 5.6. I will pm you a copy for testing by end of coming weekend. In this scenario, you would create three stacks... desktop, mobile, and tablet for instance. Then place a genetic stacks block, enter the names of the three stacks to display for different devices and go.
Thanks enil.