My view folder structure
content
home.blade.php
includes
partials
mainsection.blade.php
layout
default.blade.php
My home.blade.php
#extends('layout.default')
#section('content')
#section('partials.mainsection')
<div class="col-xs-10 col-xs-offset-1 col-md-8 col-md-offset-2 text-center">
<h1>Some Text</h1>
</div>
#stop
My mainsection.blade.php
<section class="section">
<div class="container">
<div class="row">
#yield('section')
</div>
</div>
</section>
My default.blade.php
#include('layout.header')
<div id="wrapper">
<header>
<div class="container">
#include('partials.mainNav')
</div>
</header>
<div id="main">
#yield('content')
</div>
#include('layout.footer')
</div>
My thought was that i can take the partials.mainsection view for my content so that i dont have to write everytime the section / container / row code.
So i only write some text in #section('partials.mainsection') which is wrapped by the mainsection view.
But this does not work, what do i wrong or is there any other way to do this ?
The "partials.mainsection" is only my wrapper for my content(s) so i don't have to write this every time again. If i use just #include i can't extend it from each view.
To include a partial or any other partial into your blade template the syntax is #include('view.name')
Related
I created a blog category from the menu. In Joomla 4 -> In Blog Layout -> Columns ، I can give a value to the column, but if we increase the value by one, the displayed contents are not balanced. And the "" did not close properly. After a general search, I realized that the contents are arranged as follows :
HTML :
<div class="blog-items">
<div class="blog-item">
<div class="content">1</div>
<div class="blog-item">
<div class="content">2</div>
</div>
<div class="blog-item">
<div class="content">3</div>
<div class="blog-item">
<div class="content">4</div>
<div class="blog-item">
<div class="content">5</div>
</div>
<div class="blog-item">
<div class="content">6</div>
</div>
<div class="blog-item">
<div class="content">7</div>
</div>
</div>
</div>
</div>
</div>
HTML The right way to be :
<div class="blog-items">
<div class="blog-item"><div class="content">1</div></div>
<div class="blog-item"><div class="content">2</div></div>
<div class="blog-item"><div class="content">3</div></div>
<div class="blog-item"><div class="content">4</div></div>
<div class="blog-item"><div class="content">5</div></div>
<div class="blog-item"><div class="content">6</div></div>
<div class="blog-item"><div class="content">7</div></div>
</div>
Note: When I disable "loadTemplate", the loop is displayed correctly and the divisions are closed correctly.
I also checked the information inside the "$this->loadTemplate('item')" but found no problem.
PHP :
<div class="blog-items">
<?php foreach ($this->intro_items as $key => &$item) : ?>
<div class="blog-item">
<?php
$this->item = & $item;
echo $this->loadTemplate('item'); //Included <div class="content">value</div>
?>
</div>
<?php endforeach; ?>
</div>
it's true,fixed.
All content had a tag before page break,
You cannot insert it inside a div. The closing tag will be missing. Close the tag before inserting Read More.
Little did I know that using before page break can be so destructive, and I've been looking for problems with PHP code for about a week now.
I am trying to make the footer of my website. I want to change the style.
1) Can I create a custom stylesheet and include it into the footer file?
If yes, Do I need to create a new div for any element I want to choose or can use the class provide by Bootstrap?
For example, above I created a div and than in the style file I added #mydiv?
Or there is a better solution?
<div id="mydiv">
<footer class="container-fluid" style="margin-top: 30px;">
<div class="row">
<div class="col-md-4"><img src="<?php echo get_template_directory_uri();?>/img/footer_logo.png"></div>
</div>
<div class="row">
<div class="col-md-4"><img src="<?php echo get_template_directory_uri();?>/img/ico.png"></div>
</div>
<div class="row">
<div class="col-md-4">
xx
xxx
xxx
xxx[enter image description here][1]
</div>
</div>
<div class="row">
<div class="col-md-4">2004-2017. All
rights reserved.</div>
</div>
</footer>
</div>
In addition to Bootstrap classes you can apply your own like
<footer class="container-fluid my-custom-class" style="margin-top: 30px;">
Then just select this class in CSS and apply the styling you need. Be careful, as some attributes (like width ) can be overwritten by Bootstrap.
Hope this helps.
I have a master_page.blade with global content for my html:
<!DOCTYPE html>
<html lang="es">
<head>
#include('layout.head')
</head>
<body>
#include('layout.header')
#yield('master_content')
#section('footer')
#include('layout.footer')
#show
#include('layout.scripts')
#yield('custom_scripts')
</body>
</html>
After, I have a layout in Bootstrap with 2-6 columns, this blade inherit of the master_blade, his name is 2_10_columns.blade:
#extends('layout.master_page')
#section('master_content')
<div class="container">
<div class="main-content">
<div class="col-sm-2">
#section('content1')
#show
</div>
<div class="col-sm-10">
#section('content2')
#show
</div>
</div>
</div>
#stop
Ok, this looks good but, finally I need fill the 2_10_columns.blade with some content, for example I tried this with mi contact.blade.php:
#extends('layout.2_10_columns')
#section('content1')
<p>Column 2 left content of my section...</p>
#stop
#section('content2')
<p>Column 10 right content of my section ...</p>
...some forms here
#stop
Definitely this does not work...
How could I do this with Laravel? Look at this infographic:
its working like this(simplified for example):
master layout:
<html>
<body>
<div class="container">
#yield('master_content')
</div>
</body>
</html>
2 cols layout:
#extends('layouts.master')
#section('master_content')
<div class="co-l2">
<p>index</p>
#yield('sidebar')
</div>
<div class="col-10">
#yield('content')
</div>
#endsection
contact view:
#extends('layouts.2cols')
#section('sidebar')
<p>delete</p>
#endsection
#section('content')
<h1> person name </h1>
<p>about the person</p>
#endsection
Unfortunately I won't be able to describe my issue without a visit to my site. DadGab.com.
I have a 'featured slider' col-md-8 with a sidebar to the right. It appears there is some padding or spacing set somewhere and I am unable to find it. I've checked all theme files, style.php. All I am trying to do is move the sidebar on the right side to the top of the page. The empty space did used to be a col-md-4 container which the coding has since been removed.
If I remove the featured slider code from the main page, the 'latest' posts as well as the menu do move to the top of the screen without the padding issue.
Any help would be greatly appreciated.
you have the following structure
<div class="col-md-8"></div>
<div class="clear"></div>
<div class="col-md-8"></div>
<div class="col-md-4"></div>
if i understand you corectly you should have
<div class="col-md-8"></div>
<div class="col-md-4"></div>
so join the code from both .col-md-8 containers, remove the div with class "clear" and it should be OK. This is all done in template homepage.php
You have some problems in your layout logic. You need to think about the way columns and rows work.
You should have a left column (col-md-8) and a sidebar column (col-md-4) and they should be adjacent. The left column should contain ALL of the left content.
Here's what you have:
<div class="row">
<div class="col-md-8">
<!-- featured -->
</div>
<div class="clear"><!-- SEPARATION --></div>
<div class="col-md-8">
<!-- REAST OF LEFT COLUMN -->
</div>
<div class="col-md-4">
<!--
SIDEBAR
You want this next to the left column.
But it's not adjacent!
-->
</div>
</div>
Here's what you want
<div class="row">
<div class="col-md-8">
<!-- FEATURED -->
<!-- REST OF LEFT COLUMN -->
</div>
<div class="col-md-4">
<!-- RIGHT SIDEBAR -->
</div>
</div>
Your current scenario is following
<div class="col-md-8">
featured slider
</div>
<div class="col-md-8">
content
</div>
<div class="col-md-4">
sidebar
</div>
Change it to following
<div class="col-md-8">
featured slider
content
</div>
<div class="col-md-4">
sidebar
</div>
Please let me know if issue is still there :)
After your div "col-md-8" is coming a clearfix. Just creat a "col-md-4" after "col-md-8".
I already tested here, just do it.
Inside the tags
<div class="container"><div class="row">
rearrange the order, from:
<div class="col-md-8"> ... </div>
<div class="clear"></div>
<div class="col-md-8"> ... </div>
<div class="col-md-4"> ... </div>
to:
<div class="col-md-8"> ... </div>
<div class="col-md-4"> ... </div>
<div class="clear"></div>
<div class="col-md-8"> ... </div>
In addition, consider if you really want to keep the div that clears out your floats:
<div class="clear"></div>
If not, comment it out, like so:
<!-- <div class="clear"></div> -->
This indeed moves up your sidebar to the position you want. However, I suspect you will want the last div (of class col-md-8) to be positioned higher. If so, it sounds as if you will need to create two columns inside the row (the div of class row).
I am having problem with the placing of header part above my container part using thesis theme for wordpress as i am unable to do so.
<body class=" customize-support">
<div id="logo"> </div>
<div id="container">
<div id="header">
<h1 id="site_title">
Example
</h1>
<p id="site_tagline"></p>
</div>
<ul id="menu-main-navigation" class="menu">
<div class="columns">
<div class="footer">
</div>
you can do that by adjusting css according to your need.