bug when editing/adding a block

Permalink 1 user found helpful
got a bug were I don't get a pop up when I try to edit my theme. When I click add block or edit it displays a screen with no styling i.e just text and links and pop up that usually appears doesn't.

All I added recently was

<script>
var jsArray = ["#img_one", "#img_two", '#img_three'];            
               var i=0;
               function next() {
               if (i<jsArray.length-1) {               
                  $( jsArray[i] ).fadeOut(1000,  function() {
                  i++;
                  $( jsArray[i] ).fadeIn(2000)
                  });
               }
               else {
                  $( jsArray[i] ).fadeOut(1000,  function() {
                  i=0;
                  $( jsArray[i] ).fadeIn(2000)
                  });


don't think that has anything to do with it but Im not sure.

Is this a common bug?

mikeyt55
 
JohntheFish replied on at Permalink Reply
JohntheFish
You could run through the checks in this howto:
http://www.concrete5.org/documentation/how-tos/editors/the-block-do...
mikeyt55 replied on at Permalink Reply
mikeyt55
Thanks for your replay, some useful things there I will use them again, however unfortunately none of it helped me resolve the issue.

Also tried some other themes and they are working fine. relatively new to concrete5, but I can't see anything I'm missing.

This is what I have atm,
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); ?> 
<?php Loader::element('header_required'); ?>
<?php  Loader::element('footer_required'); ?>

and this for anywere I have an editable block.
<?php $b = new Area('name_of_block'); $b->display($c); ?>


also got the login part in the footer, wont add it as it a little big for a post

Am I missing anything?

Thanks again for your replay.
enlil replied on at Permalink Reply
enlil
try:

<?php  
   $a = new Area('Area Name');
   $a->display($c);
   ?>


edit: This will create an "editable area" where you can click "add to area" and add blocks and such from the front end...
mikeyt55 replied on at Permalink Reply
mikeyt55
instead of
<?php $b = new Area('area_name'); $b->display($c); ?>
?


if so out of curiosity what is the difference, better yet is there any documentation to read?

I would think they are the same line however,
$b is being set so will override any value it had before, so changing it to an $a shouldn't make a difference.
Correct me if i'm wrong.
JohntheFish replied on at Permalink Reply
JohntheFish
mikeyt55 replied on at Permalink Reply
mikeyt55
thanks for the links :)
enlil replied on at Permalink Reply
enlil
thanks john, that template and themes page is elusive. I cant even find it navigating through the site tree. Where the heck is it ?? :D
JohntheFish replied on at Permalink Reply
JohntheFish
In the developer docs.
mikeyt55 replied on at Permalink Reply 1 Attachment
mikeyt55
I should clarify the area is editable, just when I click on it I get text on a new page, instead of a popup.
I attached a image of what I get.
enlil replied on at Permalink Reply
enlil
I would try swapping it for $a. I've seen threads here in the forums that you can use multiple $a's for multiple areas on one page without conflict but i cant seem to find one of those threads.

Here is another thread with some good info from johnthefish:

http://www.concrete5.org/community/forums/usage/code-for-editing-bl...
enlil replied on at Permalink Reply
enlil
So, it seems your code SHOULD work... I use $a across the board and dont have any problems. If that doesnt solve your issues then there is something else wrong. I've never gotten a page like the one it is throwing at you ?!
mikeyt55 replied on at Permalink Reply
mikeyt55
I tried the changing all $b to $a, but no success the same page appears. I have a feeling it is something wrong with concretes code. (that may have changed somehow)
As it is just the displaying what should be in a pop up in a blank page instead. however I can't see were this could be coming from as other themes work fine.

really have no idea were this is coming from. I have even removed the theme and then installed it again with no success.
enlil replied on at Permalink Reply
enlil
can you attach the file your trying to add the area to ??
mikeyt55 replied on at Permalink Reply 1 Attachment
mikeyt55
yep, here you go.

changed the file to a txt file, can't upload .php


EDIT: had a thought, as I was uploading this. Wouldn't be because I currently have the css in the same document?

EDIT_2: Adding the css into main.css made no difference.
enlil replied on at Permalink Reply
enlil
yes, i forgot to mention that :)

I think, right off the bat, the issue may be that your adding an area to the "default" page, which is the page that will render your pages if you dont have an "active" theme. Rather you would want to add the area to one of your "page type" files (i.e. blog_entry.php, right_sidebar.php etc) and your changes should render with an "active" theme...

EDIT: Inline styling SHOULD render correctly, but ideally you want the css in a separate .css file
mikeyt55 replied on at Permalink Reply
mikeyt55
ok so moved css to main.css
removed all blocks from default.php and left
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); ?> 
<?php Loader::element('header_required'); ?>
<?php  Loader::element('footer_required'); ?>

and the login part

and basically renamed the old default as a new template called - main_temp.
then changed the homepage page type to the new template - main_temp.

Is this what you meant?

and unfortunlty this didn't work lol
enlil replied on at Permalink Reply
enlil
if you added the main_temp.php file to your page types through the page types interface, changed your homepage to that page type, and your site is still not rendering correctly I believe its a css issue... can you send me a link?

EDIT: and possibly access, as I suppose I couldnt see this in action unless I had permissions to do so... if so PM me...
mikeyt55 replied on at Permalink Reply
mikeyt55
unfortunately not, I am running this locally atm.

and I have done exactly as you said above, no same issue.
mikeyt55 replied on at Permalink Reply 1 Attachment
mikeyt55
I have also just noticed that it is not just when going to edit a block that I get the page with no pop up. I also get it when clicking on some of the buttons in the edit menu while on the home page.

Image attached for the menu I am referring too.
enlil replied on at Permalink Reply
enlil
I suggest using firefox developer tools and trying to locate where the error is coming from, which would be my next step if I could see your site. Most likely some css...
mikeyt55 replied on at Permalink Reply
mikeyt55
well what do I say...
a break is sometimes the solution to a simple problem.

fixed the issue I was having by removing unnecessary jquery scripts.

i.e
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>


I also looked into this a little bit more to see which of the two were couseing the issue.

Test 1:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>


own its own disabled the ability to click on editable areas in edit mode. much similar to the z-index issue, were the element that you click on to add a block, has an index of 5, so any element with a higher index than 5 will cover this area.

Test 2:

<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>

on its own didn't seem to have and major issues.

Test 3:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>


having both together seemed to have the effect this post was referring too. Were the pop up after clicking to edit/add a block to a page was removed and was opened up in a browser window in a non styled webpage. i.e html with no css.

Silly mistake by me but may help others that make themes containing jquery outside of concrete then try add them to concrete.

thanks to everyone that helped me solved this issue.
enlil replied on at Permalink Reply
enlil
ah, sure enough!! c5 loads them for you. Glad you got it figured out!!