e107help.org Q&A
0 like 0 dislike

I've discovered an issue when viewing my site (which is not currently live) on a mobile display. I'm using a bootstrap (2) derived theme, and the navigation bar compacts down to a "Hamburger button" icon on small screen sizes.

The trouble is, e107_core\templates\header_default.php is inserting a hidden modal form (with ID "uiModal") into my page, and this prevents the user from being able to click the "hamburger" icon (except for a very small sliver at one edge which isn't obscured by the modal).

I've considered two options for combatting this. The first would be to override the "header_default.php" file with a customised version in my <theme_name>\templates folder. But having copied "header_default.php" to this location and modified it, it seems that e107 is not picking it up, it keeps using the version in e107_core.

The only other option I can think of would be to delete the modal using javascript at document.ready time, but this seems a bit clunky.

Can anyone tell me where I'm going wrong with using header_default.php in my theme's template folder? Thank you.

e107 version Version 2.1.8 (git)
in Themes by (78 points) 2 8 12

3 Answers

0 like 0 dislike

Further investigation led me to class2.php. I hadn't realised before, but the defined value HEADERF is the path for header_default.php, and this is set on line 1640 (as of the date-current commit). So it's a fixed string rather than something that can be modified to redirect to the active theme folder. On reflection this isn't such a bad thing, I dislike running modified version of core files, it never ends well.

 

But I still don't have a straightforward fix to the modal problem. Ideally there'd be some way to prevent header_default.php from injecting the HTML for the modal into the page (on line 694 of the current commit) - a define that could be set, or some other user assignable variable. For now I'll fall back on removing the modal from the page with JQuery.

by (78 points) 2 8 12
edited by
1 like 0 dislike
Well as you mentioned  the fixed + (line 693 +..) is likely done for some security reason happened a few years ago, to prevent the override use (just guessing here).. An yes being a core file with its possible change on update, an internal change is a 1 time only possibility (and could (again no idea) affect overall modal use). So imo if possible for your jQ addition/alternative method i would use that. ( Looks for me as a particulair 'own' theme usage, so that in a way makes it also a 'premium class/single license' product..).
Look at it in a positive way..
by (3.3k points) 7 9 11
0 like 0 dislike
Javascript and dom manipulation is correct fix. Or update to 2.3.0 and rewrite theme. Or You need new layout, not default, copy header as header_new. php and set it in theme. php. In the same core folder not in your theme.
by (2.0k points) 15 46 57
Welcome to e107 Q&A, where you can ask questions and receive answers from other members of the e107 community.
948 questions
1,352 answers
2,388 comments
2,339 users