Add links to Feature2 widgets card and content? #366
-
Hi, First af all, thank you very much for this awesome theme! 👍 I'm facing a tiny issue, that may seem trivial for theme developers. How can I make Feature2 items card, title and text clickable and associated with an href? The blog related widget get the links from the APP_BLOG, but this cannot be the case for Feature2. Thank you very much for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I'm not sure sure what functionality you're aiming for exactly, but I think if you make the item card clickable then you don't need to worry about the title or text as they're also in the card so the whole thing would be clickable. Features2 is pretty much just a wrapper for ItemGrid2 so you can either extend that or make a Features3 and ItemGrid3 if you're already using ItemGrid2 elsewhere and don't want to change it. Add a Then in the ItemGrid2 component file you can add an tag around the card (or whichever parts you want to be links) and use {href} as the target url. Alternatively if you just want the whole list of features to go to the same link you can just put an tag around the card in ItemsGrid2 and have a hard coded href. |
Beta Was this translation helpful? Give feedback.
I'm not sure sure what functionality you're aiming for exactly, but I think if you make the item card clickable then you don't need to worry about the title or text as they're also in the card so the whole thing would be clickable.
Features2 is pretty much just a wrapper for ItemGrid2 so you can either extend that or make a Features3 and ItemGrid3 if you're already using ItemGrid2 elsewhere and don't want to change it.
Add a
href?: string;
to the ItemGrid interface in the types file, which means you can set the href link in the same way the other props are set when you use the component.Then in the ItemGrid2 component file you can add an tag around the card (or whichever parts you want t…