[SOLVED] <div> starting in header template and ending in footer template |
So I know that the header template should look like so,
Code: <html> and then the footer can be, Code: <em>© 2015</em> this is clear. My trouble, however, is when I wrap the content of body (minus the scripts) in a div like so, Code: <!--header template--> it doesn't take! The page rendered has the first closing <div> positioned after the second closing <div> segment. Can anyone tell me how to get the page rendered like I want it to?
Make it like this:
header.php Code: <!DOCTYPE html> template.php Code: <div class"page-wrapper"> footer.php Code: <em>© 2015</em> What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
I would do it this way but it just isn't what I want.
The div works in tandem with a fullscreen overlay (on mobile) and helps me apply a certain behaviour to the body of the page while the menu is activating.
Then you may need to css files one for desktop and the other for mobile.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
I do not see how this suggestion will solve the problem, can you provide a little more details?
What I really need is for the div with the overlay outside the div surrounding rest of the page content. LOL, this is crazy.
Was the original question that you didn't want to start a DIV in one view and close it in another?
I'll use "header/start" and "footer/end" views, it might be a bit tricky to debug, but don't think it's necessarily too bad. Your other option is to have views withing views: Code: <html> Code: <div> And so forth.
Or if it's something dynamic, you could trigger it from controller:
PHP Code: public funciton index() Code: <!--footer template-->
(07-20-2018, 08:43 AM)InsiteFX Wrote: Then you may need to css files one for desktop and the other for mobile. (07-21-2018, 01:24 AM)Pertti Wrote: Was the original question that you didn't want to start a DIV in one view and close it in another? I did, in fact, want the opening div to be in the header template and the closing div to be in the footer template. The idea is for the content of the page (navbar to footer) to be wrapped in a div and then have a second div with an overlay. I would like to add a separate effect to the main content when the overlay is activated. Codeigniter cannot see the closing div so it doesn't work as I expect and the wrapper extends beyond the second div containing the overlay. The second suggestion appears to be an overkill IMHO.
@misterSerios
>>> The second suggestion appears to be an overkill IMHO. It is far easier to use the second method because it makes chasing bugs so much easier... especially when there are dozens of include files and variables which any one might be the problem which affects page rendering. It is easier to isolate problems by keeping the opening and closing divs, remming the included file or variable then testing with https://validator.w3.org Once the page validates, incrementally add the remmed PHP files or variables. Continue until the page fails, fix the bug, rinse and repeat. (07-21-2018, 06:22 PM)John_Betong Wrote: It is far easier to use the second method because it makes chasing bugs so much easier... especially when there are dozens of include files and variables which any one might be the problem which affects page rendering. Exactly. While I've been using the start / end in two separate files mostly, because rogue extra or missing </div> is such a pain in ass to figure out, I'm almost certain I will start converting my code into view within a view approach sooner rather than later. |
Welcome Guest, Not a member yet? Register Sign In |