Ive lost some script on my pages need help please to find it
Permalink
Hi all,
I installed some script onto all of my webpages but I need to make some changes to it. But for the life of me I cant remember where I placed it. When I go into edit mode and however all over the pages looking for it no luck. Very new to CC5 , the script looks like this
<script id="setmore_script" type="text/javascript" src="https://my.setmore.com/js/iframe/setmore_iframe.js"></script><a id="Setmore_button_iframe" style="float:none" href="https://my.setmore.com/bookingpage/029ea026-1168-41af-9172-c8e329e3ebf1"><img bordEXAMPLEEXAMPLEEXAMPLEes/bookappt/SetMore-book-button.png" alt="Book an appointment with Melange Counselling using SetMore" /></a>
It will be on most pages if not all. Can someone advise how I can find it, sill question I know. But any help would be really appreciated .
http://www.melangecounselling.com
[ P.s ] I just moved servers so SSL not installed if anyone need to look at site , or not
Thanks again
Darren
I installed some script onto all of my webpages but I need to make some changes to it. But for the life of me I cant remember where I placed it. When I go into edit mode and however all over the pages looking for it no luck. Very new to CC5 , the script looks like this
<script id="setmore_script" type="text/javascript" src="https://my.setmore.com/js/iframe/setmore_iframe.js"></script><a id="Setmore_button_iframe" style="float:none" href="https://my.setmore.com/bookingpage/029ea026-1168-41af-9172-c8e329e3ebf1"><img bordEXAMPLEEXAMPLEEXAMPLEes/bookappt/SetMore-book-button.png" alt="Book an appointment with Melange Counselling using SetMore" /></a>
It will be on most pages if not all. Can someone advise how I can find it, sill question I know. But any help would be really appreciated .
http://www.melangecounselling.com
[ P.s ] I just moved servers so SSL not installed if anyone need to look at site , or not
Thanks again
Darren
Assuming the script is in an HTML block:
- In the dashboard, revert the page (or stack or global area) version that contains the block.
- Add MrKD's UI enhancement addon and use it to make blocks visible in edit mode even if they don't have any content.
- (Last resort hack) Temporarily hack the view for the core HTML block to add some fixed marker text to it (and hack it back again afterwards)
For the future, use my Safe HTML template or @mesuva's script block.
- In the dashboard, revert the page (or stack or global area) version that contains the block.
- Add MrKD's UI enhancement addon and use it to make blocks visible in edit mode even if they don't have any content.
- (Last resort hack) Temporarily hack the view for the core HTML block to add some fixed marker text to it (and hack it back again afterwards)
For the future, use my Safe HTML template or @mesuva's script block.
Wow thanks !
Yes the script was placed using HTML block. I am just learning CC5 and I dont really understand who how to what you a lot what you mentioned
The first option you mentioned
" In the dashboard, revert the page (or stack or global area) version that contains the block." If it does what it sounds like is does I might have an issue. I have just re-install CC5 onto a new server with a Database I luck had that want corrupt due to a previous hosting proving messing up my back ups.
The the copy I have now I cant really revent anything back as I have made no changed since it was re-build on new server. yes ??
You mention { Add MrKD's UI enhancement addon and use it to make blocks visible in edit mode even if they don't have any content."
I like the sound of that and makes sense to me. What I dont get is why when u go into edit mode you can see all the stuff you are working on . Yet you cant view the HTML blocks . But if that option light up the HTML blocks id be in heaven.
The last resort hack option is best left to those well beyond my skills level.
Lastly I will have to do some research into what is Safe HTML template or @mesuva's script blo.
There was just another guy make a suggestion to me on Facebook but once again I dont yet understand it. He said " Not sure what you mean by block, but if it is a Drupal block. Just go to the admin/structure/block page and disable the block.
It could be that this is a theme or a module related bit of code in which case you would need to find where it is in the files (a Simple search with any IDE should show it).?? Well thanks heaps !!!!!!!!!!!!!!!!!!! For taking the time to help on the post .
Yes the script was placed using HTML block. I am just learning CC5 and I dont really understand who how to what you a lot what you mentioned
The first option you mentioned
" In the dashboard, revert the page (or stack or global area) version that contains the block." If it does what it sounds like is does I might have an issue. I have just re-install CC5 onto a new server with a Database I luck had that want corrupt due to a previous hosting proving messing up my back ups.
The the copy I have now I cant really revent anything back as I have made no changed since it was re-build on new server. yes ??
You mention { Add MrKD's UI enhancement addon and use it to make blocks visible in edit mode even if they don't have any content."
I like the sound of that and makes sense to me. What I dont get is why when u go into edit mode you can see all the stuff you are working on . Yet you cant view the HTML blocks . But if that option light up the HTML blocks id be in heaven.
The last resort hack option is best left to those well beyond my skills level.
Lastly I will have to do some research into what is Safe HTML template or @mesuva's script blo.
There was just another guy make a suggestion to me on Facebook but once again I dont yet understand it. He said " Not sure what you mean by block, but if it is a Drupal block. Just go to the admin/structure/block page and disable the block.
It could be that this is a theme or a module related bit of code in which case you would need to find where it is in the files (a Simple search with any IDE should show it).?? Well thanks heaps !!!!!!!!!!!!!!!!!!! For taking the time to help on the post .
Did you add the html block with dodgy script to a global area, or to individual pages?
Ignore the Facebook comment. If they think its Drupal, there is little point taking their advice about C5
Hi Johnthefish,
I have installed :
Customize Editing Interface
Safe HTML
Next challenge will be working out how they might find the missing hidden script. Or do you think the paid options you mentioned would be easier for me to use? Script Output
I looked at the document for use of the one " Customize Editing Interface " and it states "After installing this package, there will be a new Customize Editing Interface menu item available in the dashboard. On this page you will find the custom settings for the add-on.
Dashboard > System & Settings > Basics > Customize Editing Interface" I dont see that [ image attached ] What do you think?
Thanks again for taking the time to help.
Darren
I have installed :
Customize Editing Interface
Safe HTML
Next challenge will be working out how they might find the missing hidden script. Or do you think the paid options you mentioned would be easier for me to use? Script Output
I looked at the document for use of the one " Customize Editing Interface " and it states "After installing this package, there will be a new Customize Editing Interface menu item available in the dashboard. On this page you will find the custom settings for the add-on.
Dashboard > System & Settings > Basics > Customize Editing Interface" I dont see that [ image attached ] What do you think?
Thanks again for taking the time to help.
Darren
I just seen notices an add-on was yours and had a look at your site.. Wow your a bit of a CC5 guru. Thats for helping again !
Click System and Settings on the right and it will show another level of dashboard. Then follow on down clicking the links in the path until you get to customize editing interface.
Then set an option to make blocks always visible in edit mode.
That will help you to find HTML blocks that have invisible (script) content. So you can then edit them and remove the script, or use block design to give them the safe html template.
Then set an option to make blocks always visible in edit mode.
That will help you to find HTML blocks that have invisible (script) content. So you can then edit them and remove the script, or use block design to give them the safe html template.
Hi there,
I have followed your previous instructions step by step. But the HTML blocks are not being show as far as I can see and not able to see visable script I am seeking to fix. This urlhttps://www.evernote.com/shard/s620/sh/6e205887-7766-4291-a2f7-acbd1...
Is a screen grab with arrows pointing two , two TABS both called booking on right of screen as a result of the script and script is on each page that creates a booking tab , same place on the right hand side of every page. When clicked they open up a booking appointments system . The main only reason I wanted to remove the script is because as you see in shot there is one extra booking button on top right of screen on home page, that is unwanted out of place and size. I dont know how this happened I can only think I added the script twice on page out of place or something. Attached screen shot show the boxes I ticked for the add-on . Did I do it correctly ???
Thanks John...
I have followed your previous instructions step by step. But the HTML blocks are not being show as far as I can see and not able to see visable script I am seeking to fix. This urlhttps://www.evernote.com/shard/s620/sh/6e205887-7766-4291-a2f7-acbd1...
Is a screen grab with arrows pointing two , two TABS both called booking on right of screen as a result of the script and script is on each page that creates a booking tab , same place on the right hand side of every page. When clicked they open up a booking appointments system . The main only reason I wanted to remove the script is because as you see in shot there is one extra booking button on top right of screen on home page, that is unwanted out of place and size. I dont know how this happened I can only think I added the script twice on page out of place or something. Attached screen shot show the boxes I ticked for the add-on . Did I do it correctly ???
Thanks John...
Actually the arrows didnt show but you will see the two booking tabs right of screen
I asked earlier - did you add the HTML block to a page area or a global area?
Looking at the linked screenshot, there could be an effectively 'empty' HTML block immediately beneath the content block marker in the Main area.
Another possibility is beneath the logo in the Sitewide Logo area ( a global area)
Looking at the linked screenshot, there could be an effectively 'empty' HTML block immediately beneath the content block marker in the Main area.
Another possibility is beneath the logo in the Sitewide Logo area ( a global area)
Once you discover where the HTML blocks are, use block design (cog icon) to assign the 'Safe HTML' template. That will make them safe and permanently visible in edit mode.
I spoke to soon! I just found one on the home page :)
Unfortuanly it was the script for the button I want to keep. The unwanted one which is the whole mission here on the home page I cant as far as I see , locate any other html block. Given the wrong size and location, makes me wonder what the script could be in
:(
:(
Outside of edit, if you right click + view source, you will get the raw page. You may be able to locate the 2 scripts in that (use browser Find for part of the script text in the page) and, while not expecting you to work from the source, you will hopefully spot something immediately above or below that gives you a clue where you left it on the page and where to look when you edit again.
You where spot on !
On the books page as how in the video as having now html blocks
There where three [ i think scripts ] three entries
As shown here
Does this help looking at this
http://goo.gl/CFb4Rb
Its a KDE Patebin URL
On the books page as how in the video as having now html blocks
There where three [ i think scripts ] three entries
As shown here
Does this help looking at this
http://goo.gl/CFb4Rb
Its a KDE Patebin URL
The blocks are there. One is in a global area in the page header. One is in the Main area of the page.
Because they only render script, they won't show anything at their position in the page. In edit mode, they show as an empty outline of very limited height.
I suspect you just are not resting your cursor in the right place.
It is remotely possible your theme is getting in the way of editing the block in the global area. In which case you can edit blocks in global areas through the dashboard Stacks and Global Areas section.
It is also possible you have set up the block in a page type, so the block gets automatically added when you create a new page. You can check that through page types in the dashboard.
Don't start adding more blocks through either of the above mechanisms until you have your current b,lock under control.
Rather than continue looking for a block you cant find, you can also go to the sitemap in the dashboard, locate the afflicted pages, and then click to the menu for page versions. Go back though the versions to find one from before you made the mistake, make that the approved version and delete all subsequent versions. You can also do that using the versions menu from the page.
Because they only render script, they won't show anything at their position in the page. In edit mode, they show as an empty outline of very limited height.
I suspect you just are not resting your cursor in the right place.
It is remotely possible your theme is getting in the way of editing the block in the global area. In which case you can edit blocks in global areas through the dashboard Stacks and Global Areas section.
It is also possible you have set up the block in a page type, so the block gets automatically added when you create a new page. You can check that through page types in the dashboard.
Don't start adding more blocks through either of the above mechanisms until you have your current b,lock under control.
Rather than continue looking for a block you cant find, you can also go to the sitemap in the dashboard, locate the afflicted pages, and then click to the menu for page versions. Go back though the versions to find one from before you made the mistake, make that the approved version and delete all subsequent versions. You can also do that using the versions menu from the page.
Hi John
Thanks for sticking around on this
Here is a screen record of what I am seeing in edit mode and blocks not showing
http://youtu.be/oV_MtVx2Kuc
Thanks for sticking around on this
Here is a screen record of what I am seeing in edit mode and blocks not showing
http://youtu.be/oV_MtVx2Kuc
Well, Ive just had someone have a crack at finding it John. Not looking real good at this stage.
Hi melange,
In addition to what JohntheFish has recommended, here is something else you could potentially try.
1. make a full backup of your site (files and database)
2. using FTP or your web host control panel file manager, navigate to the "application/blocks" folder
3. create a new folder called "html"
application/blocks/html
4. inside the new "html" folder, create a file called "view.php"
application/blocks/html/view.php
5. open "view.php" and add the following code:
I believe this should prevent the HTML blocks from executing code and will make them visible. The HTML content will be displayed as text with a pink background and a red border. This should allow you to identify the problem HTML blocks.
After you have identified the problem HTML blocks, you can remove the created "view.php" to restore the default HTML block display.
In addition to what JohntheFish has recommended, here is something else you could potentially try.
1. make a full backup of your site (files and database)
2. using FTP or your web host control panel file manager, navigate to the "application/blocks" folder
3. create a new folder called "html"
application/blocks/html
4. inside the new "html" folder, create a file called "view.php"
application/blocks/html/view.php
5. open "view.php" and add the following code:
<?php defined('C5_EXECUTE') or die('Access Denied.'); ?> <pre style="border: 8px solid red; min-height: 100px; min-width: 100px;"> <code> <?php echo htmlentities($content); ?> </code> </pre>
I believe this should prevent the HTML blocks from executing code and will make them visible. The HTML content will be displayed as text with a pink background and a red border. This should allow you to identify the problem HTML blocks.
After you have identified the problem HTML blocks, you can remove the created "view.php" to restore the default HTML block display.
Several people have suggested I make a video so I have , no award winning work but maybe it will provide a little more insight to working towards a solution. The video is 10 mins in length and hows what the problem is, what has been tried thus far to resolve it, and shows that the last potential solution making things worse, but worth a shot. Thanks to every one who has taken time to comment it is most appreciated. Let me know your thoughts on the video . In addition to the video , here is the last solution that was suggested, I show the results implementing that potential solution in the video. VIDEO =https://www.youtube.com/watch?v=S5F8LPiXS_E&feature=youtu.be... + The instructions given for a resolvehttps://paste.kde.org/pbkizavk5#... Thanks all.
I'm closing this thread. Thanks all for the support
Hi all,
I'm back after having my little tantrum. I am hoping to try again to get this damn bit of html code off my page after lots of attempts and no luck. If anyone is still willing to help I would love to take it !!
Thanks
I'm back after having my little tantrum. I am hoping to try again to get this damn bit of html code off my page after lots of attempts and no luck. If anyone is still willing to help I would love to take it !!
Thanks
Happy to help. I'm pretty sure I've figured out the issue by looking at the source code of your site. I've sent you a PM with my contact details. Feel free to get in touch directly if you want me to sort it out for you.
Jon
Jon
If the code was added via an HTML block, the code will be stored in the database. I forget which table it would be in, but there's a forum post about it somewhere.
Searching the database for the code would be doable but not trivial.
Having found it, doing something sensible about it would require more sleuthing. Doing something non-sensible, such as reducing the code to something harmless, would be easier.
Searching the database for the code would be doable but not trivial.
Having found it, doing something sensible about it would require more sleuthing. Doing something non-sensible, such as reducing the code to something harmless, would be easier.
Just wanted to post an update on this one.
It's a really simple issue that can drive people mad. As most of you guys have already guessed, the html block doesn't render anything in place when in Edit Mode.
So I modded the view.php to this:
Now, in Edit Mode, the HTML Block is switched off and he gets a nice place holder he can click on. The interesting takeaway from all of this is that essentially, he wanted a bit of Javascript in the footer of all of his pages, so I moved it to the Tracking code box and removed the HTML Blocks anyway :)
Seems like the issue is sorted...
Been a while since I've been on the C5 forums - need to do it more often!
JohnTheFish - shall we organize another London Meetup? That was fun - always intended to do more, then life etc....
Jon
It's a really simple issue that can drive people mad. As most of you guys have already guessed, the html block doesn't render anything in place when in Edit Mode.
So I modded the view.php to this:
<?php defined('C5_EXECUTE') or die("Access Denied."); ?> <?php $page = Page::getCurrentPage(); if ($page->isEditMode()): ?> <div id="HTMLBlock<?php echo intval($bID)?>" class="HTMLBlock" style="width: 100%; height: 100px; background-color: #efefef;"> <p style="width: 100%; text-align: center; line-height: 100px; display: block;">HTML Block disabled in Edit Mode</p> </div> <?php else: ?> <div id="HTMLBlock<?php echo intval($bID)?>" class="HTMLBlock"> <?php echo $content; ?> </div> <?php endif ?>
Now, in Edit Mode, the HTML Block is switched off and he gets a nice place holder he can click on. The interesting takeaway from all of this is that essentially, he wanted a bit of Javascript in the footer of all of his pages, so I moved it to the Tracking code box and removed the HTML Blocks anyway :)
Seems like the issue is sorted...
Been a while since I've been on the C5 forums - need to do it more often!
JohnTheFish - shall we organize another London Meetup? That was fun - always intended to do more, then life etc....
Jon
@jbx Nice! Any chance of a github pull request? :)
Safe HTML addon (free) provides a template that does similar. To override the core view, just copy the template from the addon to /application/blocks/html/view.php.
Another UK meetup would be fun.
Another UK meetup would be fun.
@JohntheFish
I didn't realize I was suggesting what your Safe HTML add-on does.
I didn't realize I was suggesting what your Safe HTML add-on does.
Probably not actually.
This alters the behaviour to match what was required here, but completely disabling the HTMLBlock in Edit Mode might not be acceptable for some users.
And as @JohntheFish points out, he has an addon in the marketplace that essentially does the same thing, so I'll probably not put a pull request in for this.
Jon
This alters the behaviour to match what was required here, but completely disabling the HTMLBlock in Edit Mode might not be acceptable for some users.
And as @JohntheFish points out, he has an addon in the marketplace that essentially does the same thing, so I'll probably not put a pull request in for this.
Jon
Hi all,
Thanks to everyone who jumped on board with this ticket .
:)
Thanks to everyone who jumped on board with this ticket .
:)
his post
https://www.concrete5.org/community/forums/usage/edit-button-not-sho...