element.link not working

Hello again,

i’ll have to admit im a super beginner in JS and have no real experience with coding overall.

im currently working on my page to define “saisons” depending on the current time and while i actually managed to do it, i cant figure out how to get a link working.

    $w( '#saisonimage1' ).link = saison.linkurl;  

saison.linkurl outputs /gloves as example.

But the picture is not clickable after its set. (Also i get an error if i set a wrong page url, so it must somehow work but also doesn’t)

I hope everything i wrote makes sense to you & looking forward to get some help here.

Stay save everyone! :heart:

€Dit: After getting my related Items done, i’ve found other ways to get this done via wixLocation, gonna try it that way maybe i get a better way to do it.

Do you see any error in the console?

So maybe a better description in video.

This is the code im refering to

/localPageURL: another page on your site

you can see that a warning appear for the other pictures which have not a correct link

on my product-page(where i made it exactly the same, it works. I actually have no clue.)

€dit: I made an invisble button above the image now and it works. Still i rather would like to use the image.link

What about the live site, does it wok there? Is there any error in the dev tools console?

@jonatandor35 Sorry for the late reply, it does not work on the live-site either and there is no error in the dev tools.

@naturfellparadies
Ein Einblick in deine Datenbank könnte vielleicht aufschlussreich sein.
Aber sowas ist mir auch schon mal passiert und scheint tatsächlich ein Bug zu sein. Du solltest dies vielleicht auch mal an den Support weiter leiten.

I have had once a similar situation and i solved it the same way like you by using wix-location. Seems to be a BUG.

Würde mich ungerne an den Support wenden wenn es wirklich mein Fehler ist. (Erinnert mich immer an den Drucker support mit “ist der Drucker eingesteckt”.) Habe jetzt komplett alles umgeschrieben in einen Repeater und dies funktioniert einfach besser(habe auch da ein paar probleme aber das ist eher mein “unwissen”).

I dont like to contact the support for “me-errors”. I’ve rewritten everything now and im using a repeater with a database collection and it works way better & was actually easier. Would suggest everyone to do the same!

@naturfellparadies Ok, gut für dich wenn du dazu im Stande bist selbst Lösungen zu finden, weiter so (das macht einen echten CODER aus) → selbst ist der Mann!

Ok, then you already have found your solution (workaround). This is the way a good coder should go (find own solutions).

Good luck with your project.