gerrit
Posts: 131
|
Posted: 02/28/2017, 1:45 PM |
|
Hi,
I have a index and in my index is a include page ( page_content_inc )
And in my admin a content record.
I want make olso make blocks on my index for example my_work_inc
I have make a checkbox in my page record now I wan that if it is check it, that the block is sie in my index.php ( blocks are not dynamic )
This is what I wanne do whit more blocks on the index.
Do any body have a idea how I can do that.
Gerrit
_________________
| http://www.vision.to | |
|
|
MichaelMcDonald
Posts: 640
|
Posted: 02/28/2017, 8:02 PM |
|
Are you talking about having something hidden and when the checkbox is ticked it becomes visible without any other action ?
_________________
Central Coast, NSW, Australia.
|
|
|
gerrit
Posts: 131
|
Posted: 02/28/2017, 11:54 PM |
|
Hi,
Yes I have make a hiddenfield in the blocks.
So I think if hiddenfield is 1 than the block is visable.
So it need the data from a db page_content
Can I make this whit a php function ?
Why blocks
I have make the cms in bootstrap but bootstrap have more blocks and I do like that
So you have the content and blocks like my work slider or my service .......
That is what I try to make.
_________________
| http://www.vision.to | |
|
|
MichaelMcDonald
Posts: 640
|
Posted: 03/01/2017, 2:27 AM |
|
php when untick would have to 'submit' to refresh page to unhide block. I think jquery is solution.
when block is visible is this when must perform db lookup or can it happen before block visible ?
_________________
Central Coast, NSW, Australia.
|
|
|
gerrit
Posts: 131
|
Posted: 03/01/2017, 2:43 AM |
|
Hi,
Thanks for response.
And how can I do that in jquery, Iam not so wel With jquery.
I think I go use about 5 blocks.
_________________
| http://www.vision.to | |
|
|
MichaelMcDonald
Posts: 640
|
Posted: 03/01/2017, 9:31 AM |
|
What does blocks contain?
Grid?
Textbox?
_________________
Central Coast, NSW, Australia.
|
|
|
gerrit
Posts: 131
|
Posted: 03/01/2017, 10:37 AM |
|
Hi,
A grid whit textbox, images, username name,
And a other block have a slider With images,
Gerrit
_________________
| http://www.vision.to | |
|
|
MichaelMcDonald
Posts: 640
|
Posted: 03/01/2017, 5:47 PM |
|
I haven't tested ...
<!-- Div & Block -->
<div id = "block1" style="display:none">
Put your block here .........
<div>
<! -- checkbox -->
<input type="checkbox" onchange="getcheckbox1()" id="checkbox1">
<script>
function getcheckbox1(){
if($('#checkbox1').is( ":checked" ) ) {
/* you could just try an alert here*/
alert("is checked");
$('block1').show();
}
if($(#checkbox1).prop('checked', false)){
$('block1').hide();
}
}
</script>
and this is good resource....
http://stackoverflow.com/questions/22545561/jquery-checkbox-is-unchecked
_________________
Central Coast, NSW, Australia.
|
|
|
gerrit
Posts: 131
|
Posted: 03/02/2017, 11:26 AM |
|
Thanks Michael,
I'll test this again when I'm out of the hospital this takes quite a while about two weeks.
I think it Will work.
_________________
| http://www.vision.to | |
|
|
MichaelMcDonald
Posts: 640
|
Posted: 03/02/2017, 9:08 PM |
|
ok and then we can look at 'AJAX' POST (jquery post checkbox value and other fields) to another .php file to be use in a query and return query results as a live dataset (grid,etc) to any block without page refresh.
_________________
Central Coast, NSW, Australia.
|
|
|
gerrit
Posts: 131
|
Posted: 03/23/2017, 4:04 AM |
|
Quote MichaelMcDonald:
ok and then we can look at 'AJAX' POST (jquery post checkbox value and other fields) to another .php file to be use in a query and return query results as a live dataset (grid,etc) to any block without page refresh.
Hi,
Sorry but I have make it show or hidde panel, I don't know where I was whit my head
But thanks Micheal for your support.
_________________
| http://www.vision.to | |
|
|
MichaelMcDonald
Posts: 640
|
Posted: 03/31/2017, 3:12 PM |
|
Place a div around the panel and give it the ID's block1, etc..
_________________
Central Coast, NSW, Australia.
|
|
|