728x90

The Popup Settings -- Triggers option allows users to set a trigger and a cookie on a popup.   

This article describes the 'Cookie' option in the popup editor.  Refer to the related article below for information to set a popup trigger.

Related article: 'Triggers' options settings.


Article Contents

 

  • Add a New Cookie
  • 'Cookie Settings -- General' option settings box
  • 'Cookie Settings -- Advanced' option settings box
  • Options to Set and Link a Cookie to a Trigger
  • Set and Link a Cookie When Adding a New Trigger
  • Set and Link a Cookie When Editing an Existing Trigger
  • Set A Browser Cookie When Submitting A Form
  • Set a Browser Cookie 'On Click' Inside a Popup

 


Definition of Terms

Triggers -- These are 'events' that cause a popup to display in the browser. A popup requires at least one trigger in order to display, and may accept multiple triggers. 

Cookies -- These control the repeated display of popups in the browser. To work, they must be set and linked to a popup trigger.  Cookies are assigned an identification (ID) number formatted as 'pum-{integer}'. The use of one or more cookies with a trigger is optional, but often recommended. 

By default, cookies are valid for a term of 1 month,  which can be changed by plugin users to a different value. Popups controlled by a cookie can redisplay before they expire if the popup cookie is cleared from the visitor's browser. 

[   Back to top ]


When the button labeled 'Add New Cookie' is selected, a popup labeled   'When should your cookie be created?' will appear.  Five (5) cookie setting options are provided with the base (free) version of Popup Maker.  The plugin default is set to the first option value, 'On Popup Close'. 

They include:

1. On Popup Close -- A cookie is set in the browser when the popup is closed (default);

2. On Popup Open -- A cookie is set in the browser when the popup is opened;

3. Subscription Form: Successful  -- This cookie option is intended for use with our MailChimp Integration plugin extension to Popup Maker.  It is also available for use with the Popup Maker 'Subscription Form' shortcode integrated with a 3rd party email marketing plugin or application registered with Popup Maker.  

Plugin users of either  Ninja Forms, GravityForms, or Contact Form 7 should continue to use either of the first 2 cookie options above, plus their respective Popup Maker 'form submit success' cookies (see 'related article' links below). 

Related article: Ninja Forms Submit Success integration cookie

Related article: GravityForms Submit Success integration cookie

Related article: Contact Form 7 Submit Success integration cookie

4. Subscription Form: Already Subscribed -- This cookie option is intended for use with our MailChimp Integration plugin extension to Popup Maker.  It is also available for use with the Popup Maker 'Subscription Form' shortcode integrated with a 3rd party email marketing plugin or application registered with Popup Maker.  

5. Manual Javascript -- Select this option when using form plugins for which Popup Maker does not have a specific integration:

a)  All other WordPress form plugins.

b)  MailChimp for Wordpress,

This cookie option setting is also available to set a browser cookie when selecting content inside a popup 'on click'. See the section  'Set a Browser Cookie 'On Click' Inside a Popup' below for details.

Each of the 5 cookie options listed above is described at length in the related article link below. 

Related article:  'Cookie Settings and Features'.

[   Back to top ]


Upon adding a cookie option, the 'Cookie Settings -- General' option settings box will appear. 

The custom fields shown include:

Cookie Name -- Popup Maker automatically assigns a cookie an ID number formatted as 'pum-{integer}'. This ID is used to link a cookie to a trigger. 

Cookie Time -- By default, cookies are valid for a term of 1 month. This can be changed by plugin users to a different value. Acceptable units of time include: 

  • seconds,
  • minute(s),
  • hour(s),
  • day(s),
  • month(s), and 
  • year(s)

[   Back to top ]


Popup Maker provides some 'advanced' option settings, whose defaults seldom need to be changed.

The custom fields shown include:

Use Session Cookie? -- By default, this option is turned 'off'. Modern browsers can keep web pages (and browser sessions) open indefinitely, even when browsers and devices are not in use. We maintain this option setting for plugin version backward compatibility. Most plugin users have no need to turn the option 'on'. 

Sitewide Cookie -- By default, this option is turned 'on'. It applies Popup Maker cookies throughout a site, controlling the repeat display of popups on any site page. 

[   Back to top ]


Cookies can be set and linked to a trigger either: 

  1. when adding a new trigger, or
  2. by editing an existing trigger. 
  1. From the 'Trigger' option settings tab, select the button labeled 'Add New Trigger'. 

2.  From the popup titled 'Choose what type of trigger to add?', select the checkbox labeled: 'Would you like to set up a cookie as well?'. 

3. Choose from among the five (5) cookie options presented below, then select the 'Add' button to add the trigger and link the cookie. The plugin default selection is set to 'On Popup Close'. 

4. Depending on which trigger is selected, the matching option setting box will appear: 

'Click Trigger Settings -- General' option settings,

 or  Time Delay Settings -- General' option settings.

In the 'Cookie Name' custom field, Popup Maker automatically generates and assigns the trigger a new cookie with an ID of 'pum-{integer}'.

5.  The trigger is set and linked to a new cookie. In the example above, a 'Click Open' trigger is set, and linked to a cookie set to launch 'On Popup Close'. The cookie has an ID of 'pum-40'.

[   Back to top ]


1. To add and link a cookie to a trigger, edit an existing trigger. Select the 'pencil' icon from the 'Popup Settings -- Trigger' option settings tab. 

2a. Edit an existing 'Click Open' trigger --  The 'Click Trigger Settings' option settings popup will appear. On the 'General' tab, select the custom field labeled 'Cookie Name'.  An 'Add New Cookie' option will appear. Select the option to add it to the custom field, then select the 'Update' button. 

2b. Edit an existing 'Time Delay / Auto Open' trigger -- The 'Time Delay Settings' option settings popup will appear. On the 'General' tab, select the custom field labeled 'Cookie Name'.  An 'Add New Cookie' option will appear. Select the option to add it to the custom field, then select the 'Update' button. 

Note: The process described above in Step 2 for the 'Click Open' and 'Auto Open / Time Delay' triggers is the same for any premium trigger available as a  plugin extension to Popup Maker

3.  The plugin will prompt with a popup labeled 'When should your popup be created?'.  The plugin default option is set to 'On Popup Close', with four (4) additional option settings available. 

Either accept the plugin default option, or select a different option, and then click the button labeled 'Add' to move to the next step. 

5.  The 'Cookie Settings -- General' option settings box will appear displaying two (2) custom fields; 'Cookie Name' and 'Cookie Time'. 

'Cookie Name' is a cookie with an identification (ID) format of 'pum-{integer}' (for example, 'pum-40').  

'Cookie Time' is an expiration term for the cookie. The plugin default value is 1 month, which can be changed to a value that ranges from minutes to years. 

To accept the values for 'Cookie Name' and 'Cookie Time', select the 'Update' button. 

6.  In the image above, a 'Time Delay / Auto Open' trigger is now linked to an 'On Popup Close' cookie via the cookie ID of 'pum-40'. 

[   Back to top ]


Popup Maker adds a 'form submit success' cookie option for any of the WordPress form plugins listed below when they are activated with our plugin.

Note: Popup Maker is a Ninja Forms affiliate. We provide support for each other’s products. 

Any WordPress form plugin other than those listed above should set a 'form submit success' cookie via the 'Manual JavaScript' option setting. See the related article link below for details.

Related article:   Close Popup and Create Cookie When a Form is Submitted 

[   Back to top ] 


The 'Manual JavaScript' cookie option was discussed previously in the section titled  'Add a New Cookie' (list item #5).  It can be used to set a browser cookie on form submit success with any WordPress form plugin other than the 3 plugins with which Popup Maker directly integrates. 

This cookie option can also be used to set a browser cookie 'on click' of any content displayed inside a popup. For example, a popup displays by a 'Time Delay / Auto Open' trigger. The popup contain 2 images, and the visitor is encouraged to click on one or the other image. 

The 'Manual JavaScript' cookie option can be used to set a browser cookie 'on click' when either popup image is selected.  See the related article link below for details, including cookie option setting and custom code. 

Related article: Create Cookie On the Click of an Element Within Your Popup.

[   Back to top ]

Did this answer your question?

Yes 

728x90

WPML enables you to translate the texts coming from themes and plugins you use in your sites. This allows you to have a completely translated site. Additionally, it allows the users of your site’s administration area to use the interface in their native language.

Localization options and performance optimization

You can find the settings for theme and plugins localization on the WPML -> Theme and plugins localization page.

Main theme and plugins localization options

WPML allows you to create translations for texts in themes and plugins in three ways:

  • Use only String Translation.
  • Use String Translation but load .mo files as a backup.
  • Don’t use String Translation but only load the .mo files. This is a good option when you already have a theme with the translations you need.

Theme and plugins localization options can significantly impact the performance of your site. WPML version 3.8 and later automatically suggests the most efficient localization options.

Message prompting to use WPML’s String Translation only

By default, it prompts you to use WPML’s String Translation only, by loading all the translations from the .mo files into the database. This importing is done once and after it is complete (it can take a while, depending on your site), the performance will be optimal in regards to theme and plugins localization.

String Translation announce that it will start loading all the translations from the .mo files

String Translation is loading all the translations from the .mo files

Finally, String Translation warns you once this process has finished.

String Translation loaded all the translations from the .mo files into the database

Translating the theme and plugins using WPML’s String Translation

This option requires WPML’s String Translation module, available as a part of the Multilingual CMS account type.

As we already mentioned, when using String Translation to translate the theme and plugins texts, you can select to load the .mo files as a backup or not.

When loading the .mo file as a backup is selected, WPML will fall back to .mo file translations if those exist in your theme and plugins. This means that if you see a translated text string in your site which does not seem to appear under String Translation, it is very likely that the translation comes from a .mo file in your theme or plugin.

When either of these options is used, WPML scans the theme and finds the texts that can be translated. It reports what it finds and let you enter translations, right from within WordPress.

Since version 3.8 and later, by default, WPML automatically prompts you to scan for new texts in your site whenever a theme or a plugin is activated.

Scanning themes for texts

Scanning themes for strings

You can also manually start the scanning of themes for texts. Select the themes to scan and click on Scan selected themes for strings.  WPML goes through all the files in the selected themes to extract translatable texts from them (texts that are wrapped with gettext functions).

The scanner shows how many strings were found in the theme and their translation status. You can translate them from the WPML -> String Translation page.

In the Localization options section, under Other options, you can find an option to Use theme or plugin text domains when gettext calls do not use a string literal. This option might be helpful if you are using a theme which uses gettext incorrectly.

Scanning plugins for texts

Similarly to scanning a theme for strings, WPML can scan plugins and find translatable strings.

Scanning plugins for texts

Select the plugins to scan and click on Scan selected plugins for strings.

Please note that there is a limitation with scanning the Must Use (MU) plugins. Usually, MUplugins consist of a single file and you can translate them normally. However, if the author has included sub folders which are called from the MU plugin, WPML String Translation cannot access them. This means WPML cannot scan and translate files contained in these sub folders.

Translating the strings

Administrators and Editors can translate theme and plugins texts on the WPML -> String Translation page.

Translating texts via WPML’s String Translation

To translate a text, use the search controls on the top of the page to filter the specific strings. Most importantly, select the domain (it should feature a theme or plugin’s name) whose texts you want to display and translate.

To manually translate listed texts, click the translations link for the text in question, enter the translation, select the Translation is complete checkbox and click Save. If you see translations of the text in question, marked in yellow, this is the translation coming from the theme or plugin’s .mo files. If you prefer, you can override them with your own, by selecting the Use my translation option and providing the translation in question.

You can also assign the selected texts and send them for translation by your designated local translators or professional translation service. For this, you need to have the WPML Translation Management module installed on your site.

Choose the strings to translate, the languages to translate them into and click on the button to Add to translation basket.

Selecting text strings to send to translation

From the Translation Basket tab of the WPML -> Translation Management page, you will then be able to select the translator and send the selected texts for translation.

Your local translators will be able to access the String Translation screen and translate just the ones that you’ve sent them for translation.

Specifying the locales for different languages

A locale is a code which determines which language variant to use for different languages. It is comprised of a combination of language and country.

For example “en_US” means American (USA) English and “en_GB” means English used in the UK.

The locales table in WPML is already pre-populated with the correct values for all popular languages. You should edit it only if you want to use a different language/country combination or if you have added your custom languages. For instance, the default locale for Spanish is “es_ES” (for Spain), but you can change it to Mexican Spanish by setting the Spanish locale to “es_MX”.

To edit the locales, go to the WPML -> Languages page and click the Edit Languages link found in the Site Languages section.

Locale settings

Getting Translation Files for WordPress Itself

In the past, you needed to use the Theme and plugins localization page to download the translations of WordPress core files.

Now, WPML does this automatically any time you add a language on the WPML -> Languages page or during WPML installation.WPML enables you to translate the texts coming from themes and plugins you use in your sites. This allows you to have a completely translated site. Additionally, it allows the users of your site’s administration area to use the interface in their native language.

Localization options and performance optimization

You can find the settings for theme and plugins localization on the WPML -> Theme and plugins localization page.

Main theme and plugins localization options

WPML allows you to create translations for texts in themes and plugins in three ways:

  • Use only String Translation.
  • Use String Translation but load .mo files as a backup.
  • Don’t use String Translation but only load the .mo files. This is a good option when you already have a theme with the translations you need.

Theme and plugins localization options can significantly impact the performance of your site. WPML version 3.8 and later automatically suggests the most efficient localization options.

Message prompting to use WPML’s String Translation only

By default, it prompts you to use WPML’s String Translation only, by loading all the translations from the .mo files into the database. This importing is done once and after it is complete (it can take a while, depending on your site), the performance will be optimal in regards to theme and plugins localization.

String Translation announce that it will start loading all the translations from the .mo files

String Translation is loading all the translations from the .mo files

Finally, String Translation warns you once this process has finished.

String Translation loaded all the translations from the .mo files into the database

Translating the theme and plugins using WPML’s String Translation

This option requires WPML’s String Translation module, available as a part of the Multilingual CMS account type.

As we already mentioned, when using String Translation to translate the theme and plugins texts, you can select to load the .mo files as a backup or not.

When loading the .mo file as a backup is selected, WPML will fall back to .mo file translations if those exist in your theme and plugins. This means that if you see a translated text string in your site which does not seem to appear under String Translation, it is very likely that the translation comes from a .mo file in your theme or plugin.

When either of these options is used, WPML scans the theme and finds the texts that can be translated. It reports what it finds and let you enter translations, right from within WordPress.

Since version 3.8 and later, by default, WPML automatically prompts you to scan for new texts in your site whenever a theme or a plugin is activated.

Scanning themes for texts

Scanning themes for strings

You can also manually start the scanning of themes for texts. Select the themes to scan and click on Scan selected themes for strings.  WPML goes through all the files in the selected themes to extract translatable texts from them (texts that are wrapped with gettext functions).

The scanner shows how many strings were found in the theme and their translation status. You can translate them from the WPML -> String Translation page.

In the Localization options section, under Other options, you can find an option to Use theme or plugin text domains when gettext calls do not use a string literal. This option might be helpful if you are using a theme which uses gettext incorrectly.

Scanning plugins for texts

Similarly to scanning a theme for strings, WPML can scan plugins and find translatable strings.

Scanning plugins for texts

Select the plugins to scan and click on Scan selected plugins for strings.

Please note that there is a limitation with scanning the Must Use (MU) plugins. Usually, MUplugins consist of a single file and you can translate them normally. However, if the author has included sub folders which are called from the MU plugin, WPML String Translation cannot access them. This means WPML cannot scan and translate files contained in these sub folders.

Translating the strings

Administrators and Editors can translate theme and plugins texts on the WPML -> String Translation page.

Translating texts via WPML’s String Translation

To translate a text, use the search controls on the top of the page to filter the specific strings. Most importantly, select the domain (it should feature a theme or plugin’s name) whose texts you want to display and translate.

To manually translate listed texts, click the translations link for the text in question, enter the translation, select the Translation is complete checkbox and click Save. If you see translations of the text in question, marked in yellow, this is the translation coming from the theme or plugin’s .mo files. If you prefer, you can override them with your own, by selecting the Use my translation option and providing the translation in question.

You can also assign the selected texts and send them for translation by your designated local translators or professional translation service. For this, you need to have the WPML Translation Management module installed on your site.

Choose the strings to translate, the languages to translate them into and click on the button to Add to translation basket.

Selecting text strings to send to translation

From the Translation Basket tab of the WPML -> Translation Management page, you will then be able to select the translator and send the selected texts for translation.

Your local translators will be able to access the String Translation screen and translate just the ones that you’ve sent them for translation.

Specifying the locales for different languages

A locale is a code which determines which language variant to use for different languages. It is comprised of a combination of language and country.

For example “en_US” means American (USA) English and “en_GB” means English used in the UK.

The locales table in WPML is already pre-populated with the correct values for all popular languages. You should edit it only if you want to use a different language/country combination or if you have added your custom languages. For instance, the default locale for Spanish is “es_ES” (for Spain), but you can change it to Mexican Spanish by setting the Spanish locale to “es_MX”.

To edit the locales, go to the WPML -> Languages page and click the Edit Languages link found in the Site Languages section.

Locale settings

Getting Translation Files for WordPress Itself

In the past, you needed to use the Theme and plugins localization page to download the translations of WordPress core files.

Now, WPML does this automatically any time you add a language on the WPML -> Languages page or during WPML installation.

728x90

Is there a way to generate a random number based on a min and max?

For example, if min was 1 and max 20 it should generate any number between 1 and 20, including 1 and 20?

 

 

 

<?php $min=1; $max=20; echo rand($min,$max); ?>

 

 

 

 

 

 

728x90
  • html 내용이 변경된것을 감지하려면, onchange를 사용하는 것이 아니라,
    DOM변경을 감지하는 이벤트(DOMSubtreeModified)를 씁니다.

    크로스브라우징을 지원하려면, 아래처럼 두개 이벤트를 같이 사용하면 되구요~
    DOMSubtreeModified : IE9이상, 나머지 브라우저 지원
    propertychange : IE9미만 지원

    $(function(){
        $('.amount.final').on('DOMSubtreeModified propertychange', function() {
            $('#summary_total_price').text( $(this).text() );
        });
    });
  • 알타블루 
    16-12-28 13:53 

    소스보기

  • 네. 답변 감사합니다.  알려 주신 소스로 해보고 있습니다. 아직 되지는 않는데요.. 
    중요한 내용을 알려주셨네요. 감사합니다.
  • 알타블루 
    16-12-30 18:10 

    소스보기

  • 해결되었습니다. 소채님의 힌트로 해결되었고 성공한 소스는 아래를 참조 하세요.

    $('변경을 체크하려는 클래스 또는 ID').on('DOMSubtreeModified', function() {
          $('.입력하려는 클래스 또는 ID').text( $('.입력 값이 있는 클래스 또는 ID').text() );
        });

    잘 안되던 이유는 변경을 체크하려는 클래스가 입력값이 있는 클래스가 아니고 상위 영역이 통째로 변경되던걸 늦게 알았네요.

    참조하세요.

 

참고로 HTML 내용이 변경된 것을 감지하는 것이지, 클래스 등이 변경되는 것을 감지하는 것은 아니다.

+ Recent posts