0

I'm using a Laravel app with an external public directory, e.g. root/Laravel, and root/html/public.

I need this app to load from a require on an php file that already has another framework(root/html/this-section.php), hence that other fw has its own head, and body tag. This app will load between the header and footer of that index.

In my blade layout.app file, i have

@section('stylesheets')
  <link rel="stylesheet" href="/this-section/css/vendors.css">
  <link rel="stylesheet" href="/this-section/css/app.css"> 
@show

<div id="main">
  @include('layouts.sidebar')
  @include('layouts.header')
  <section>
    @yield('content')
  </section>
</div>

The issue I'm having is if no my app layout, when I delete the head and body tags during testing, which is what i need, the blade system, or what i dont know, is still creating an empty head tag set, <head></head>, then when i enable the stylesheets section, it ends up in that <head> tag.

Expected: The head tag should not be there. I don't want a head tag. What in laravel can i adjust to remove this auto creation of head (and body)?

blamb
  • 4,220
  • 4
  • 32
  • 50
  • 2
    Do you see a `` tag in the source, or in the browser's inspector? Browsers will add a `` tag in the inspector on their own. Show us your code. – ceejayoz Oct 06 '17 at 17:12
  • Hmm, in the inspector, when you say source, you mean ctrl + u? e.g. browser source? Actually I don't.. Thanks for pointing tha tout. So that's not my problem then, Looks like I will need to update my question. However go ahead and put this in as an answer if you want, and Ill add the question else where so as not to complicate things. Unless you think I should add it here. My problem is the main route `/` and the route `/this-section` are both working, but acting different, one is not loading the meta tag that i have on `html/this-section.php` and one is. probably its `.htaccess` – blamb Oct 06 '17 at 17:16
  • I put the followup issue here https://stackoverflow.com/questions/46611387/laravel-index-route-issue-when-using-for-a-subsection-in-another-fw-external-pu – blamb Oct 06 '17 at 17:54

1 Answers1

1

It sounds like your using tags that belong in the <head> section is causing this. While your source may be pristine:

enter image description here

browsers will add in the missing-but-required tags as appropriate, resulting in you seeing them in the browser's web inspector:

enter image description here

ceejayoz
  • 176,543
  • 40
  • 303
  • 368