oper url from a carousel
# 🤝help
c
Hi, I am building a carousel for a car reseller. I am using the code below. The issue with this code is that the browser open in a new window the link associated with the button in the carousel. The customer wants the browser has to open the link in the same page where the bot is loaded. How can I achive this? the code for the carousel is: const createCardForProductCar = (product, index) => { let priceText; if (product.actualPrice === undefined && product.sellingPrice !== undefined) { priceText = `Prezzo: ${product.sellingPrice.toString()} euro`; } else if (product.actualPrice !== undefined && product.sellingPrice === undefined) { priceText = `Prezzo: ${product.actualPrice.toString()} euro`; } else if (product.actualPrice === undefined && product.sellingPrice === undefined) { priceText = `Prezzo su richiesta`; } return { type: 'card', title: { dynamicValue:
${product.name}
, valueType: 'dynamic' }, subtitle: { dynamicValue:
Copy code
Alimentazione: ${product.engineType} -
        Anno: ${product.registrationYear} -
        ${priceText} -
        Chilometraggio: ${product.vehicleKm} km
, valueType: 'dynamic'}, imageUrl: { dynamicValue:
${product.carImage}
, valueType: 'dynamic' }, actions: [ { action: 'url', label: { dynamicValue: 'Apri', valueType: 'dynamic' }, value: { dynamicValue:
${product.url}
, valueType: 'dynamic' } } ] }; } const carouselItemsCar = user.selected_ProductDict.map((product, index) => createCardForProductCar(product, index)); bp.dm.replyToEvent(event, { type: 'carousel', items: carouselItemsCar });
2 Views