-
AuthorPosts
-
July 3, 2017 at 1:00 am #1045529
I have created a little date script for my site so the copyright year at the bottom would update automatically instead of having to manually edit it each year. (I only inserted the spaces in the "script" tags here because this editor wouldn’t show it otherwise.)
<div>© < script> document.write(new Date().getFullYear()) < /script> My company. All rights reserved.</div>
Then I tried to create a "Widget" element for it, but when I select the module by name or position, this script breaks the backend, and only shows what you can see in the attached picture.
Is there a way to prevent custom inline scripts from executing in the backend so they wouldn’t conflict? I remember that in previous versions, modules inserted as widgets wouldn’t load in the backed, it was only indicated that a module is there, and it wasn’t a bad practice. That way it wouldn’t be possible for modules to break the backend of JA Builder.
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
July 4, 2017 at 2:07 am #1045826Hi,
Which type of module you add this script? custom html module?
July 4, 2017 at 2:29 am #1045836Hello,
I forgot to mention, yes, it’s just a simple custom html module with only this script inside it.
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
July 5, 2017 at 9:05 am #1046276Could you share the credentials so I will take a look? when I tried to add above script into a custom html module, then load into builder, it shows the plain text instead.
July 10, 2017 at 12:24 am #1047048This reply has been marked as private.Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
July 11, 2017 at 9:20 am #1047644Kindly check the script in a standard template of Joomla like Protostart / Beez and see how it works first.
July 11, 2017 at 4:52 pm #1047763I have checked it, I have it working on different sites with e.g. the Ja Simpli template, but of course it works with every other template since they work differently. The problem is only that it breaks the Ja Builder while trying to edit a page. Have you logged in and tried to edit the page called "test"? A simple solution would be to prevent the Builder from loading modules while editing the page like it did in previous versions. In the first few versions, not even the navigation bar menu was loaded, it only showed a sign that the menu will be there after saving. It was a great way, it should be implemented for all modules and this way enabling to insert inline scripts in them.
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
July 12, 2017 at 6:54 am #1047996Kindly check the attached screenshot, I add this script into a custom html module and load into builder via Spotlight block. Other blocks show fine but the custom html also display plain text. On your site, I guess there is another script cause that conflict.
July 13, 2017 at 7:43 pm #1048520You haven’t removed the spaces in the script tags. Like I’ve stated in my first post, "I only inserted the spaces in the "script" tags here because this editor wouldn’t show it otherwise." You see that in the script tag, there’s a space after "<", and also in the closing tag, please kindly remove these 2 and then try it again. It doesn’t even run on your demo, because it’s not a valid html element with the space in it, of course it doesn’t conflict that way. I’ve also tried on a fresh JA Builder install, and unfortunately, it was the same.
Saguaros ModeratorSaguaros
- Join date:
- September 2014
- Posts:
- 31405
- Downloads:
- 237
- Uploads:
- 471
- Thanks:
- 845
- Thanked:
- 5346 times in 4964 posts
July 17, 2017 at 3:06 pm #1049232It seems there is conflict with JS of tool. But as I can see that it only show the year there, why not simply add the number there?
July 17, 2017 at 8:58 pm #1049276Because I have many websites, and it’s easier if the year updates automatically so I doesn’t have to modify it every year on every website.
July 17, 2017 at 10:18 pm #1049286Okay I have fixed it myself by externally inserting the year into a span via jQuery.
AuthorPostsViewing 12 posts - 1 through 12 (of 12 total)This topic contains 11 replies, has 2 voices, and was last updated by ferike 6 years, 10 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum
Jump to forum