Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • ferike Friend
    #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.


    1. Screenshot-from-2017-07-03-02-51-59
    Saguaros Moderator
    #1045826

    Hi,

    Which type of module you add this script? custom html module?

    ferike Friend
    #1045836

    Hello,

    I forgot to mention, yes, it’s just a simple custom html module with only this script inside it.

    Saguaros Moderator
    #1046276

    Could 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.

    ferike Friend
    #1047048
    This reply has been marked as private.
    Saguaros Moderator
    #1047644

    Kindly check the script in a standard template of Joomla like Protostart / Beez and see how it works first.

    ferike Friend
    #1047763

    I 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 Moderator
    #1047996

    Kindly 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.


    1. screenshot-localhost-2017-07-12-13-52-42
    ferike Friend
    #1048520

    You 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 Moderator
    #1049232

    It 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?

    ferike Friend
    #1049276

    Because 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.

    ferike Friend
    #1049286

    Okay I have fixed it myself by externally inserting the year into a span via jQuery.

Viewing 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