I have a problem with the “smart rules” if you can help me please:
I happen to have created a module that fulfills the carousel task, which I made with swiper js. The module works correctly, each slide has 2 columns, on the left an image and on the right text. This is dynamic, you can add as many slides as you want, and you can edit the image and text as you like. Both in the editor, in the preview and in the published page it works correctly. The problem appears when I apply smart rules, for example in my case, I have applied the smart rule of country, then for colombia I want to show some content and in mexico for example I want to show a different content. In the editor it looks correct, in the preview, it also looks good. The problem appears when I publish it, when I go to the public link no content appears. So I inspect the code in the browser and I can see that the structure is displayed (div, classes, id, etc), what I can not see is the content, it is as if it did not exist.
That is the problem that I can’t solve.
Thanks for your help.
Hey @Jose10 from what I’ve seen in the past this has been a jQuery issue, are you using jQuery in your HubSpot account? If so, does switching the version to another version alieviate this?
If not, if you could provide a link to your page I can take a deeper look!
Thank you very much for your answer and for your intention to help, thank you very much.
I will provide more details of what is happening:
Module
The module is a slider which uses the Swiper library https://swiperjs.com/ and works correctly without smart rules. Each slide consists of 2 columns, the left column is an image and the right column has image and text. These two columns are enclosed in a box which is a slide. These slides have a repeater which allows the user to add as many slides as desired.
Things I have managed to discard:
The problem has nothing to do with either the image or the text. I created another image and text module, but not a slider, and it looks correct, both with and without smart rules.
Supposed conclusion.
The problem is in the slider, because as I mentioned before, the image and text module work correctly, but apparently when the intelligent rule detects the slider there is a conflict.
Clarification:
The slider works correctly when the smart rules are not applied, the error occurs when I apply the smart rule of the country.
It is true that I would need a VPN to verify if by putting another country different from mine, to be able to view what I have done, but in this case it does not apply because I am just adding the smart rule of my country. And in the case of other countries, I have people in those places who can verify what I am saying and the error continues to occur
Also clarify that in the HubSpot editor everything is seen correctly and even in the preview, but when I visit the public page, that is where the error is detected.
I will show you the HTML, CSS and JS code, in addition, how I view the error and what I managed to see in the inspector
I could leave the error page, but I would need you to specify the country you are in please to apply the smart rule according to your location.
HTML
I can’t say for sure what’s causing this issue. When I tested it on a dummy page then my content was visible if you can share more details like a screenshot of your smart rules or the code of your module it can help us to identify the issue.
“I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!”
Thank you very much for your answer and for your intention to help, thank you very much.
I will provide more details of what is happening:
Module
The module is a slider which uses the Swiper library https://swiperjs.com/ and works correctly without smart rules. Each slide consists of 2 columns, the left column is an image and the right column has image and text. These two columns are enclosed in a box which is a slide. These slides have a repeater which allows the user to add as many slides as desired.
Things I have managed to discard:
The problem has nothing to do with either the image or the text. I created another image and text module, but not a slider, and it looks correct, both with and without smart rules.
Supposed conclusion.
The problem is in the slider, because as I mentioned before, the image and text module work correctly, but apparently when the intelligent rule detects the slider there is a conflict.
Clarification:
The slider works correctly when the smart rules are not applied, the error occurs when I apply the smart rule of the country.
It is true that I would need a VPN to verify if by putting another country different from mine, to be able to view what I have done, but in this case it does not apply because I am just adding the smart rule of my country. And in the case of other countries, I have people in those places who can verify what I am saying and the error continues to occur
Also clarify that in the HubSpot editor everything is seen correctly and even in the preview, but when I visit the public page, that is where the error is detected.
I will show you the HTML, CSS and JS code, in addition, how I view the error and what I managed to see in the inspector
I could leave the error page, but I would need you to specify the country you are in please to apply the smart rule according to your location.
HTML
It sounds like you’ve done a great job setting up your carousel module with Swiper JS, making it dynamic and functional in the editor, preview, and published page—well done! However, the issue with your “smart rules” for country-specific content sounds frustrating. When you apply a smart rule to show different content for Colombia and Mexico, it seems to work perfectly in the editor and preview, but when you publish it, the content disappears despite the structure being present in the code. This suggests that the smart rules might not be properly triggering or rendering the content when the page is live.
One thing to check is whether the smart rules are correctly configured and whether they have any dependencies or conditions that might not be met when the page is live. Ensure that all required data for the smart rules is available and correctly passed in the live environment. Additionally, verify if there are any JavaScript errors or conflicts in the console that might be preventing the content from rendering. Sometimes, discrepancies between the preview environment and the live environment can cause issues like this, possibly due to differences in data availability or script execution. If everything seems correct and the problem persists, it might be helpful to reach out to support for the platform or tool you’re using, as they might have more specific insights or solutions for handling smart rules in live environment