top of page

Forum Posts

dwight
Feb 14, 2021
In Coding with Velo
I must be missing something obvious ... Our site provides several places where certain (Admin) functionality is limited to the site owner. We accomplished this via code using getRoles() to determine if the site owner was logged in. If so, then certain parts of the site are made visible. This has been working great. Recently we added wix bookings to our site. With that, we've invited some members to be "Bookings Staff Members" so they can manage their calendars. Sometime after that we received questions that these "Bookings Staff Members" were able to see/access the admin functions of the site. Turns out, getRoles() for these "Bookings Staff Members" is returning "Admin" as their role. But, https://www.wix.com/velo/reference/wix-users/user/getroles says "The site owner: The promise resolves to the admin's roles with an additional role containing the name"Admin". In this case, a logged in member who is NOT the owner is being identified as "Admin". As a workaround I created a new role, "Administrator" and assigned this user to the new role. The user in question now has two roles listed on my site's Settings->Roles&Permissions page; "Bookings Staff Member" and "Administrator". However, on the live site when this user is logged in, getRoles() still returns only "Admin". In case you're wondering, this is the code that is checking the roles of the current user: let user = wixUsers.currentUser user.getRoles() .then( (roles) => { console.log(roles) }) Is there any wisdom you can share? Thx!
0
1
58
dwight
Dec 27, 2020
In Coding with Velo
I've added the wix reCaptcha element for the first time on my site. I added the onVerified() function and connected to the element in the editor. On the published site, the captcha responds with the "pick images with _________" challenge as expected. After successful completion of the challenge, a green check mark appears where there was a check box, but ... The onVerified() function is never called! Any ideas?
0
1
41
dwight
Nov 20, 2020
In Coding with Velo
Code that I introduced on my site through the Tracking and Analytics feature of wix is no longer working. It appears to no longer be executed. In researching this, several prominent wix support pages are no longer valid links: https://support.wix.com/en/article/about-tracking-tools-analytics https://support.wix.com/en/article/managing-your-tracking-tools Has something changed? Or is something changing in the way we add tracking code to our sites? Thanks for your help.
0
3
25
dwight
Nov 19, 2020
In Coding with Velo
The *original* problem: we're unable to add an iframe in an html component to our sites that accesses the camera and microphone. The cause of this is two-fold as I understand. First, wix wraps our iframe inside its own iframe wrapper. While our iframe includes the allow microphone; camera, the wrapper iframe does not. Second, browsers have begun requiring iframe to explicitly allow use of mic & camera. Almost a year ago, I stumbled upon a means of adding the the required "allow mic; camera" to the wrapper iframe by adding the following code to the Body-end via the Tracking & Analytics page: <script> var iframes = document.querySelectorAll("iframe"); for (var i = 0; i < iframes.length; i++) { var name = iframes[i].getAttribute("name") if (name.includes("htmlComp-iframe")) { iframes[i].setAttribute("allow", "microphone; camera") } } </script> Now here's the *new* problem. This solution quit working in the past week. My question for the group is why? It appears that this code is simply no longer being executed. I've verified the code is still in the body-end of the page by viewing the page source. It's just not adding the "allow" as it used to. Can anyone shed light on this? Thanks for your help!
1
16
1k
dwight
Dec 19, 2018
In Coding with Velo
I have a database on my site with userId as the key. I have easy access in code to the userId of the currently logged-in user with: let user = wixUsers.currentUser; let userId = wixUsers.currentUser.id I would like to add records to this database for existing site members so that when they access the page with this database, I can present their unique information by keying on their userId. For example, Fred is a member of my site. I can see him in my members list and I can give Fred various permissions/roles. Is there a way to find Fred's userId without asking Fred to login?
0
2
1k
dwight
Jul 16, 2018
In Coding with Velo
I am adding javascript from biblegateway.com as described here. The javascript will chage bible verse references on a page to hyperlinks that open a pop-over window containing the text of that verse. The snippet being added is: <script src="https://www.biblegateway.com/public/link-to-us/tooltips/bglinks.js" type="text/javascript"></script> <script type="text/javascript"> BGLinks.version = "ESV"; BGLinks.linkVerses(); </script> I've added this code to my site using Tracking Tools & Analytics in the Body-End section. I have "Add code to All Pages" selected. And I've tried both options: load code once, and load code on each new page It WORKS on the first page I open on my site, OR, if I refresh the page I am looking at. However, if I navigate to another page of my site via the menu then on that second page, it's as if this code hasn't run. The bible scripture references are not hyperlinks. BUT, if I refresh the page, they are converted to hyperlinks as intended. For example: visit aorhope.org/get-help-now You will note that the reference to Matthew 5:23-24 is a hyperlink that opens a pop-over from Biblegateway. Now navigate to any other page via the menu. Then use the back button to go back to the get-help-now page. Those hyperlinks that worked a moment ago are gone. BUT, if you refresh the page then the links work again. This smells like something related to the two options above (load once/load each page) but I get the same behavior with both options. It's like the "load with each new page" isn't having affect? Any ideas how to make this work reliably?
0
3
936

dwight

More actions
bottom of page