I would like to get the html code of a texteditor.
I use this texteditor http://adminbootstrap.com/wb/right/0.3.0/texteditor.html .
I've a form with the texteditor inside it but when I would like to get the html code with:
$request->input('texteditor');
It doesn't work and whereas I gave a name to the texteditor,
What is going wrong?
My view code:
<form>
<div class="container-fluid half-padding">
<div class="pages pages_dashboard">
<div class="row">
<div class="col-md-12">
<div class="panel panel-warning">
<div class="panel-heading">
<h3 class="panel-title">Contenu de l'actualitée</h3>
</div>
<div class="template template_texteditor">
<div class="summernote"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
And
<div class='summernote'></div>
dynamically creating other div and the html code is contained in
<div class='note-editable panel-body' name='texteditor'></div>
EDIT 1
Another way :
$('.summernote').summernote('code');
to get the entire html code of summernote texteditor
You currently have no textarea form field that is being sent back to the server that contains the wanted content.
The simple thing would be to change
<div class='note-editable panel-body' name='texteditor'></div>
to
<textarea class='note-editable panel-body' name='texteditor'></textarea>
or run some javascript on form submit to add this as post['textarea'] from the TEXT of the div content
Related
I made a one pager Wordpress page. I am using custom fields to make my page editable. I've created a template.php where I've put all my index.php code in. Everything is working well and I've been able to add image - and text fields. But the latest text field I've been trying to add, is not showing up on my template page when I put it near the end of the page. If I put it in another section on my page it shows up fine, but for some reason it wont get the text string from the custom field when I put it where I want it (as in, the text field is there but there is no text in it).
Thanks in advance for the help!
<div class="section" id="section4">
<div class="col-12 col-md-12 col-lg-12">
<div class="container" id="container_message">
<div class="header">Send me a message!</div>
<div class="subheader">Lets stay in touch</div>
<div class="container" id="container_text">
<div class="image_handtext"><img src="<?php echo get_stylesheet_directory_uri(); ?>/imgs/H.png"/></div>
<div class="image_handtext"><img src="<?php echo get_stylesheet_directory_uri(); ?>/imgs/E.png"/></div>
<div class="image_handtext"><img src="<?php echo get_stylesheet_directory_uri(); ?>/imgs/j.png"/></div>
<div class="contact">
<h1><?php the_field('contact_text'); ?></h1>
</div>
</div>
<!--<button class="button">Send me a message</button>-->
</div>
</div>
</div>
So I already have a main page then dynamic pages. But I want to know how to generate a dynamic page within a the generated page. For example, www.whatever.com/something.php?q=something?p=something
I want to make the dynamic page contain other dynamic pages within so I can switch out content in that page.
Any ideas?
So this page is done by www.website.com/folder/main.php?c=page1, in this div I want to do other content
<div class="col s9 grey right">
<!-- Teal page content -->
<div class="card-panel z-depth-2">
<div class="row center">
<div class="col s12">
<?php include 'content.php';?>
</div><!---panel personal stats---->
</div><!---profile container row--->
</div>
</div>
Within that url I'm trying to get something like this
www.website.com/folder/main.php?c=page1/content/content?q=othercontent
$_GET
Search in internet $_GET and Url parameters, i.e. GET URL parameter in PHP
<div class="col s9 grey right">
<!-- Teal page content -->
<div class="card-panel z-depth-2">
<div class="row center">
<div class="col s12">
<?php include 'content.php';
if ($_GET['c'] == 'page') {
echo 'Ala ma kotA';
} else {
echo 'Ala nie ma kotA';
}
?>
</div><!---panel personal stats---->
</div><!---profile container row--->
I have a piece of jquery code which load a file as
$(".data_container").load(base_path+"sign_up/signup.php?trigger_id=random");
Signup.php contains
<?php include_once("../libs/php_header/php_header.php"); ?>
<div class="ui modal s_umodal">
<i class="close icon"></i>
<div class="header">
Modal Title
</div>
<div class="image content">
<div class="image">
An image can appear on left or an icon
</div>
<div class="description">
A description can appear on the right
</div>
</div>
<div class="actions">
<div class="ui button">Cancel</div>
<div class="ui button">OK</div>
</div>
</div>
<script>
$('.s_umodal')
.modal('show');
</script>
The problem is, I can call the modal box and it shows up. but next time I click on the trigger button (button to show modal) it display another one even though I have closed the previous one. so now I am left with two modal boxes. and if I click multiple times i will be left with multiple modal boxes. I am using Semantic-UI.
The problem with your implementation is that every time you call $('.data_container').load(base_path+"sign_up/signup.php?trigger_id=random"); you are creating a new dom element with the div you are fetching from that ajax call. $('.s_umodal').modal('show'); is then showing all of the modal boxes returned from the server.
Without restructuring your code significantly, One approach is to not keep fetching the content of the div over and over again. The <div> will be a part of the main html that contains data_container. Your Ajax call can return the script that shows the dialog box.
HTML:
<div class="data_container"></div>
<div class="ui modal s_umodal">
<i class="close icon"></i>
<div class="header">
Modal Title
</div>
<div class="image content">
<div class="image">
An image can appear on left or an icon
</div>
<div class="description">
A description can appear on the right
</div>
</div>
<div class="actions">
<div class="ui button">Cancel</div>
<div class="ui button">OK</div>
</div>
</div>
Your Ajax call could be returning:
<script>
$('.s_umodal').modal('show');
</script>
Your call to load the content could remain the same.
$(".data_container").load(base_path+"sign_up/signup.php?trigger_id=random");
If you are up for a significant change however, You can try to use JSON web services instead of returning <script>.
I want to make a layout like the attached image.Blocks will render on the page in the same order number.
For example :- block(1) will show first after then block (2) and so on...
ah! this one below works perfectly. Check this bootply i quickly did.
<div class="col-sm-3">
<div class="col-sm-12">1</div>
<div class="col-sm-12">5</div>
</div>
<div class="col-sm-3">
<div class="col-sm-12">2</div>
<div class="col-sm-12">6</div>
</div>
<div class="col-sm-3">
<div class="col-sm-12">3</div>
<div class="col-sm-12">7</div>
</div>
<div class="col-sm-3">
<div class="col-sm-12">4</div>
<div class="col-sm-12">8</div>
</div>
I know you will want to push and pull once you want to rearrange the order of the div in extra small screen so this is a link to push and pull very well answered on Stack Overflow.
Masonry is a popular JS library to handle this: http://masonry.desandro.com/
Assuming your HTML looks like this:
<div id="container">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<!-- More items... -->
</div>
The JS would look like this:
var msnry = new Masonry('#container', {
columnWidth: 200,
itemSelector: '.item'
});
Or if you prefer jQuery:
$('#container').masonry({
columnWidth: 200,
itemSelector: '.item'
});
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).