I am trying to create a card component where the entire card is a clickable link that navigates to a different page. Is there a way to add a link to a container? How can I get this intended behavior?
Hey @eezunn , there’s no option to add a link to a container itself. You can add links to text, images, buttons, shapes and other ‘content’ elements.
For example you can add a links to stretched images inside a container.
It’s kind of sad how that isn’t a feature. In HTML/CSS, you can just wrap the whole DOM in an anchor tag.
Not to say that your tool sucks. Just that it would be really convenient to have such a feature.
Please look into adding links to containers - I agree with Caleb that it is a necessary feature. Right now, I’m having to add a transparent image to every container and then link to that - very cumbersome.
Thanks everyone. To piggyback off Colin’s method, you can also make a button and make its design features transparent, put that within the container and link to that.
+1 on this badly needed
as the workaround for this, stretched transparent elements inside the container, could be used, as like buttons, or images. We can understand that this solution is not perfect. Along with this, we keep tracking this thread, thanks all for new feedback.
Any progress on this feature? The workaround of stretched transparent elements doesn’t work when my elements are stacked…
Use following Code and replace the link -
import wixLocation from 'wix-location';
$w.onReady(function () {
$w("#box1").onClick(() => {
wixLocation.to("https://example.com");
});
});
Change the ID of container as well.
Following…I’m also looking to have the container linked to the dataset for the dynamic page.