Laravel 4 - How to render child view which @extends('parent'), without the parent

Viewed 2239

Well, the title might be a bit confusing, so let me put some light on the situation. I have a base template in Blade containing basic html and navigation, which looks like this:

<!DOCTYPE html>
    <html lang="pl">
        <head>
                <meta charset="utf-8">
                <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">

                @section('title')
                    <title>Page Title</title>
                @show
    </head>
    <body>

    <div id="wrapper">

        <header id="logo"></header>

        <nav id="mainmenu">
            <ul>
                <li><a href="page1">Page 1</a></li>
                <li><a href="page2">Page 2</a></li>
                <li><a href="page3">Page 3</a></li>
                <li><a href="page4">Page 4</a></li>
            </ul>
        </nav>

        @yield('content')

    </div>

    </body>
</html>

And then a bunch of child views for each page, which go like this:

@extends('layouts.base')

@section('title')
    <title>Page 1</title>
@stop

@section('content')

<section class="container clearfix">

    <h2 class="section-title">Page 1</h2>
    <div class="content">
              some content here
    </div>
</section>

@stop

Now, what I want is being able to conditionally ignore the @extends(), so that I can return a view which is just the child view, that is everything within section of class "container", for being able to stack it up into one-page layout or load using AJAX.

Any idea on how to achieve this?

2 Answers
Related