Support the ongoing development of Laravel.io →
posted 10 years ago
Requests
Last updated 2 years ago.
0

What "design"? Are you editing .blade.php-files?

Last updated 2 years ago.
0

Yes I am editing the html structure. At main.blade.php at the bottom of body is a a javascript placed. But laravel places it it in a in div.

When I write </div></div><div> after @yield('content'), the javascript is where is has to be. But there are no div openings! Im totally confused about this.

Last updated 2 years ago.
0

have you closed the @yield ? If not, write @show or @stop. After the content.

Last updated 2 years ago.
0

@yield('content') will include everything inside from another view between:

@section('content') @stop

You might have some divs opening there without closing tags.

I always find it best to have both open and close tags in a single view. This saves a lot of headaches :)

Last updated 2 years ago.
0

Wow this solved my problem entirely! Thank you very much! I onlyincluded @stop at the bottom of the page that gets included.

Do you know an online version of this https://github.com/Stolz/laravel-html-tidy

The source code is quite sloppy and every beautifier will riun the code.

Tried to install laravel using composer for 4 days, I gave up on this. Followed all help instructions. Maybe its because Im running Mac OS on a non mac computer.

Last updated 2 years ago.
0

Actually nvm. It only placed the content of <head> into the <body>.

@yield('content') includes user_home.blade.php

The first version works, the javascript is outsite the wrapper.

@layout('main')



@section('content')





    @if(!empty($news->results))
        @foreach ($news->results as $n)
            <div class="news_item">

                <h3>{{ htmlspecialchars($n->title) }}</h3>
                <div class="news_info">by the<strong> Staff</strong> at {{ date('Y-n-j H:i ', strtotime($n->created_at)) }}</div>
                <br />
                <?php $b = new BBcode; ?>
                <p class="news_text">{{ $b->toHTML(nl2br(htmlspecialchars($n->body))) }}</p>
            </div>
        @endforeach

        {{ $news->links() }}
        @endif
    @endsection



@endsection

This one does not, the javascript is inside the wrapper.

@layout('main')



@section('content')



<div id="task-box" class="box g8">
	<div class="header">
		<span class="icon icon-notestasksalt"></span>Dashboard
	</div>
	<div id="intro" class="content scroll ov-no">
		<div class="scroll-cont">
			<ul class="rows">
			
			    @if(!empty($news->results))
			        @foreach ($news->results as $n)
			
						<li class="task done">
							{{ htmlspecialchars($n->title) }}
							<p>
							<?php $b = new BBcode; ?>
							{{ $b->toHTML(nl2br(htmlspecialchars($n->body))) }}
							</p>
							<div class="task-progress" style="width: 100%;"></div>
				            <span class="task-prog-ind">{{ date('Y-n-j H:i ', strtotime($n->created_at)) }}</span>
						</li>
			
			        @endforeach
			
			        {{ $news->links() }}
			        @endif
			    @endsection
			</ul>
		</div>
	</div>
</div>

@endsection

I have no idea why. Any help appreciated.

Last updated 2 years ago.
0

Found the solution. The source coder made a mistake. There is one @endif too much. :-)

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.