When in edit mode I do get the style applied and everything is fine and works as expected.
When I exit edit mode, the style is still applied and I get this displayed in the upper left of the browser: isEditMode()) { ?>
If I remove the php code to apply the style, the page is all good, except when in edit mode, I can’t get to the sticky menu.
Really don’t want to mess with the css unless we have to. We actually got this snippet from one of Andrew’s legacy videos (Theme Development P4) and have used it in the past.
Thanks for all the help. But I am really at a loss (not the first time), but this is a new one to me.
I’ve tried everything I know including all your suggestions with the most recent post by ConcreteOwl.
Here is the strange thing. In my HTML I have this:
<!-- trying Posted C5 Fix-->
<?php echo "<h1>Not Editing</h1>"; ?> // THIS DISPLAYs in Either Case!!!
<?php if ($c->isEditMode()) { ?> //THIS CODE DOES NOT SEEM TO BE EXECUTING!
<div style="height: 50px"> </div>
<?php echo "<h1>AM Editing</h1>"; ?>
<?php } ?>
<!-- End -->
Pretty straight forward. If not Logged in display NOT editing, if logged in display AM editing…
I’ve attached several snapshots showing in Edit Mode and Non-Edit Mode
Your original post appears to have some php comments wrapping the code.
php comments instruct the browser to not execute the php instruction between the comments and display them as normal text.
OMG and Embarrassed!!! I wasted a bunch of everyone’s time.
I did not realize that there is a caveat to isEditMode. Apparently, one needs to actually begin the Edit process (i.e. edit the page - Pencil/Add Content). I assumed that when one was logged in, you are in edit mode!!!
After revisiting Andrew’s video, I did not realize that he was already in EDIT mode in the backend, so when he posted the code it worked fine. But had he not of been in edit mode it would not have worked much like mine. Viewer oversight.
So I believe my final resolution is this (mostly from all the suggestions and a quick google) - if anyone sees a hole here please let me know):
May not be the best solution, but it certainly does represent the original HTML template almost to the pixel and in edit mode all is well and fine.
I don’t think it’s a total loss from my perspective (not withstanding everyone’s time/effort) and that being said the other posts/suggestion will come in handy in the future I’m sure.
Learning new things are harder than knowing old things.
Truly, thanks everyone.
Hope everyone has a great Holiday Season - cheers.
The video that you refer to is some 12 years old now and concretecms has evolved a lot since then.
The php language has also evolved a lot and the latest offering from php.net is version 8.x, this is much more strict than the php version of 12 years ago, I would recommend that using php short tags should be avoided if possible.
Glad you got it sorted now and I know the members on this forum are only too happy to help.