Skip to Content
Menu
This question has been flagged

Hello!

I added an option at the customize menü where i added a class which loads a badge :after the image. 

when i click my snippet option this adds the class and after the reload of the page the JS adds the class and the badge to the image --> OK 

the JS --> myjs.js:

 $(document).ready( function() { $('img.img_badge-header').after('<img src="/website_theme/static/src/img/badge/img_badge-test.png" class="img_badge-header-after">'); });

the CSS:

.img_badge-header-after {

//background-color: @bg_yellow;

width: 100px;

height: 200px;

position: absolute;

top: 70%;

right: 10%;

}

load in website_template.xml JS :

<template id="assets_frontend" inherit_id="website.assets_frontend" name="my theme">

<xpath expr="." position="inside"> <script src="/website/static/src/js/myjs.js"></script>

<!-- <script type="text/javascript" src="/website/static/src/js/sticky.js"></script>-->

</xpath>

</template>

the Snippet Option: 

<xpath expr="//div[@data-snippet-option-id='transform']//li" position="after">

<li class="dropdown-submenu" data-required="true"> <a tabindex="-1" href="#">Badges</a> <ul class="dropdown-menu"> <li class="dropdown-submenu"> <a tabindex="-2" href="#">Positionierung</a> <ul class="dropdown-menu"> <li data-value='pfot_img_badge-header'><a>Header-Badge</a></li> </ul> </li> </ul> </li>

now i ihave the problem that the badge is shown all the time, is this a caching problem or is the java script not loaded again  ? 

Is it written into database ? or how can i remove the badge again  ?

cheers joe

Avatar
Discard
Related Posts Replies Views Activity
1
Sep 23
2727
1
Dec 23
12154
1
Apr 20
9421
0
Sep 17
4142
2
May 17
8543