Edit buttons missing in C5 Header

Permalink
Hey Guys,

I'm stuck.
I can't figure out why the edit buttons are missing
in my concrete5 installation. I created a custom theme,
uploaded it to theme folder. Opened C5 and imported it,
activated and tested, it displays correctly.

I have both header and footer code blocks in template.
Header right after head tag, and footer right before closing body tag.

I've done search after search after search, only found the same thing. Make sure header and especially footer are in the code.

Also only had one JS script running, removed it, still had the problem.I put the script back.

Any ideas?

webnut
 
ScottSandbakken replied on at Permalink Reply
ScottSandbakken
Have you verified that the DOM is structured correctly?

Can you post the URL so I can take a look?
webnut replied on at Permalink Reply
webnut
*removed link to prevent any bot caching before it's ready*

There ya go.

Thanks for the suggestion.

It all looks good to me, but I've been
staring at it for a while. Another pair
of eyes would be helpful.
webnut replied on at Permalink Reply
webnut
Just noticed this code in the header php code.
<style type="text/css">body {margin-top: 49px !important;} </style>


I have margin for my body element defined as .5em, considerably less than 49px. Would this be the cause???

I don't want to have adjust my template to fix this but I'm going to see what happens. I can figure out a workaround if need be.
webnut replied on at Permalink Reply
webnut
no, didn't make a difference.
mhawke replied on at Permalink Reply
mhawke
In my experience, this kind of problem is usually caused by a JavaScript error on the page that halts the toolbar rendering. Put your page in edit mode and right-click on the page and choose 'Inspect Element'. Then choose the 'Console' tab and see if it's reporting an error.

You can also put the page in edit mode and then right-click and 'View Source'. Scroll down to the bottom to see if PHP has crashed with an error. In order to see PHP errors, you might have to turn error messages on by going to 'Dashboard > System and Settings > Debug Level'.

Can you attach the page type file you're using? You'll have to rename it from xxxx.php to xxxx.txt in order to post it on this forum.
webnut replied on at Permalink Reply
webnut
Well I've fixed it.
It was the XML declaration at the beginning.
I've removed it and the edit bar shows up magically.

I don't remember why i had it in there but for some
reason I think C5 needs it? Can anyone verify if the
XML declaration is required please.

Thank you

p.s
Thanks guys for taking a look. ;)
webnut replied on at Permalink Best Answer Reply
webnut
correction, it wasn't the declaration that I removed, it was some php code that I needed to add that I removed.

header("Content-type: text/xml");


I believe it's needed as I added code to the htaccess file
to process xml, and avoid the xml error.

I'm not sure why removing it worked and why it hasn't seemed
to cause any other issues???
mhawke replied on at Permalink Reply
mhawke
None of my sites have this so I have no idea why you would need it.
webnut replied on at Permalink Reply
webnut
oh, I think I remember now.
It was a server specific setting i had to enable to allow php to be rendered as php and xml as xml. As both have <? it was the suggested resolution.
webnut replied on at Permalink Reply
webnut
now the question is, has anyone else had to do this to get C5 to work past the XML error that pops up after an install?

And secondly, as I needed it before, but it causes problems now, it appears I am in a dilemma, what to do? Add it back in or leave it out?

I've never had to add this code either, so I don't know the correct approach to take on this one. I don't know what to expect if I leave it out.
mhawke replied on at Permalink Reply
mhawke
Are you talking about php's "short_open_tag" ? If your server is set up to allow short open tags such as <? instead of requiring <?php ?> then there can be some confusion when processing xml which also has an opening tag of <? but I have to say that my server allows short open tags and I have no problem upgrading any of my sites.
webnut replied on at Permalink Reply
webnut
Well it must be then.
mhawke replied on at Permalink Reply
mhawke
I'm no XML expert but I believe you put 'header("Content-type: text/xml")' on pages where you want the server to spit out XML rather than standard HTML so leaving it off of standard HTML pages should be fine.
webnut replied on at Permalink Reply
webnut
Right.

But you do need the XML declaration when writing XHTML code right?

For example, this is my code:


<?php
   print ("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
  print ("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"
           \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n");
  print ("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\n");
?>
<head>


It was this:
<?php
   header("Content-type: text/xml");
   print ("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
  print ("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">");
  print ("<html version=\"-//W3C//DTD XHTML 1.1//EN\" xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">");
?>


So I did remove the header bit of code. But if I look at the source code in FF I get the error at the XML declaration that I'm trying to use XML in an HTML webpage. Now if I add the header php code I then break the C5 edit bar. I can live with the error, I just find it very strange and it's eating at me.
mhawke replied on at Permalink Reply
mhawke
Hey, I'm the first to admit that I don't know a lick about XML and XHTML so someone else needs to step in here and help. None of my sites need any of the XHTML/XML mumbo-jumbo you're fighting with. I think you're treating the symptom and not the cause.

Here's what's at the top of all my pages and they all just work:
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">


I think you need to bug your host about this and see what they have to say.
webnut replied on at Permalink Reply
webnut
ah, but then -correct me if I'm wrong- but your coding in HTML5 right?

Just curious but it also helps me.
Im thinking I'm going to leave the XML and Doctype as is for now and research this in depth as time allows.

Thanks btw for the help. :)
mhawke replied on at Permalink Reply
mhawke
Interesting article and conversation here:

http://mathiasbynens.be/notes/xhtml5...