-
-
Save danieliser/07e71479187150721afec430ae8c9775 to your computer and use it in GitHub Desktop.
@Samuroid - Try this newer method which provides more control: https://github.com/PopupMaker/Popup-Maker/wiki/Popup-Maker-JavaScript-&-jQuery-API#pumsetcookie-function-el-settings
@Samuroid - Try this newer method which provides more control: https://github.com/PopupMaker/Popup-Maker/wiki/Popup-Maker-JavaScript-&-jQuery-API#pumsetcookie-function-el-settings
Thank you. I have it working now. With my implementation of using the user select a language from the banner. I have thought of a bit of a stumbling block.
If they come to the site from google search and it's not the homepage. Then when they select the language flag, it's taking them to the homepage, which would not be the page they had been initially looking for. I do have the WPLM plugin to deal with translation but now I'll need to work out a solution for providing current URL of the page they entered the website on.
@Samuroid - Doesn't WPML have a language switcher shortcode? It uses cookies & URL's to save state already and changes the current URL. Could that not do the trick?
Alternatively, you will have to remap the URL to the new language when they choose it via JavaScript string manipulations before redirecting.
With current Popup Maker plugin I had to use this:
const popupElement = document.querySelector('#pum-<id> or .pum class');
PUM.setCookie(popupElement);
// (or window.PUM)
@strarsis the the popupElement
you pass in gets passed to PUM.getPopup()
. That is a magic
function of sorts and will accept an element, a numeric ID #, or a selector. So you could probably shortcut and just do PUM.setCookie(<id>)
similar to the example aboves PUM.close(1483)
Hi
I am having issues with this. I have followed the popupmaker documentations with the same code but to no avail.
I have 2 images in my popup that are language flags. On clicking them, they link to the website's url for that language.
I have set the class in both a tags elements and tried it in the img tags. When clicking the image it loads the page but the popup shows again.
Anything you think I might be missing?