Layer or object appear only once per browser session

All WYSIWYG Web Builder support issues that are not covered in the forums below.
Forum rules
PLEASE READ THE FORUM RULES BEFORE YOU POST:
viewtopic.php?f=12&t=1901

MUST READ:
http://www.wysiwygwebbuilder.com/getting_started.html
WYSIWYG Web Builder FAQ
Sergio Morais
 
 
Posts: 37
Joined: Wed Aug 14, 2013 3:55 pm

Layer or object appear only once per browser session

Post by Sergio Morais » Thu Jun 07, 2018 10:11 am

Hi,

Is it possible to get a normal layer or object to only show itself once per browser session?
Pretty much like a cookie script...

Regards,
Sergio
WWB11

User avatar
BaconFries
 
 
Posts: 4167
Joined: Thu Aug 16, 2007 7:32 pm

Re: Layer or object appear only once per browser session

Post by BaconFries » Thu Jun 07, 2018 10:14 am


User avatar
Pablo
 
Posts: 13944
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Layer or object appear only once per browser session

Post by Pablo » Thu Jun 07, 2018 10:15 am

That will require a script.

Maybe you can use the script from this template?
http://www.wysiwygwebbuilder.com/suppor ... orate.html

Sergio Morais
 
 
Posts: 37
Joined: Wed Aug 14, 2013 3:55 pm

Re: Layer or object appear only once per browser session

Post by Sergio Morais » Thu Jun 07, 2018 11:34 am

OK
It seems I will have to upgrade as WWB11 claims "unsupported format" upon opening said template.
Once upgraded, am I right to assume that by incorporating (copy/paste) the objects in the template's "newsletter popup" into my project I should be able to get it to work similarly?

Regards

User avatar
Pablo
 
Posts: 13944
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Layer or object appear only once per browser session

Post by Pablo » Thu Jun 07, 2018 11:47 am

Correct, the template only works with version 14

The included script is just an example, you may need to tweak it a little bit.


Sergio Morais
 
 
Posts: 37
Joined: Wed Aug 14, 2013 3:55 pm

Re: Layer or object appear only once per browser session

Post by Sergio Morais » Mon Jun 11, 2018 9:44 pm

Hi,

I have upgraded to WWB v14 and am now able to open the "Corporate" template.

The dialog box contains the checkbox which validates the "Don't show this popup again" option.
What I cannot find is the instruction that makes this checkbox only appear once after it has been checked.
How is this controlled?

Also, can this instruction be attributed to a shape or image, for instance an "OK" button?
The purpose would be to validate the message in the dialog box, closing the popup and refraining from showing up again in that browser session.

Regards,

User avatar
Pablo
 
Posts: 13944
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Layer or object appear only once per browser session

Post by Pablo » Tue Jun 12, 2018 5:57 am

How is this controlled?
There is a HTML object on the dialog. This contain JavaScript code which implement the checkbox functionality.
Also, can this instruction be attributed to a shape or image, for instance an "OK" button?
Changing the behavior of the script require JavaScript knowledge.

Sergio Morais
 
 
Posts: 37
Joined: Wed Aug 14, 2013 3:55 pm

Re: Layer or object appear only once per browser session

Post by Sergio Morais » Tue Jun 12, 2018 1:42 pm

Hi,

I have used the newsletter popup from the template. Works as advertised.
However, my attempts at getting a normal layer to close such as the dialog box does, have been unfruitful.
Replacing the code "$("#newsLetterPopup").dialog("open");" with "$("#newsLetterPopup").layer("open");" (the layer ID is newsLetterPopup) has done nothing; I suspect because the syntax and/or semantics are incorrect..

If possible, I would prefer to use a layer and not a dialog box for the following reasons:
1. I would like a full width layer and not a centered popup window.
2. The dialog box style setting is erratic. Sometimes colours do not change and other times, even though the "use jquery UI theme" is set to false, it still seems to draw on the selected page properties theme.

Can it be done without mad programming skills?

Regards,

User avatar
Pablo
 
Posts: 13944
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Layer or object appear only once per browser session

Post by Pablo » Tue Jun 12, 2018 2:02 pm

You can open/close a layer with events (show/hide)
or via code
$("#newsLetterPopup").show();
$("#newsLetterPopup").hide();

Note that I cannot teach you how to write custom code.

Sergio Morais
 
 
Posts: 37
Joined: Wed Aug 14, 2013 3:55 pm

Re: Layer or object appear only once per browser session

Post by Sergio Morais » Tue Jun 12, 2018 3:26 pm

Thanks for that.

I can appreciate that you do not have the time to develop custom code for us all...

Indeed, these instructions do close the layer. The problem lies with the creation of the cookie.

When these objects are in normal layer, the Html box does not seems to complete the job of creating the cookie when the "newsLetterCheckBox" is checked.

Naturally, the result is the recurring popup message every time the page is loaded...

In case you want take a look:
https://tinyurl.com/yazwrrs5

Regards,

User avatar
Pablo
 
Posts: 13944
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Layer or object appear only once per browser session

Post by Pablo » Tue Jun 12, 2018 3:57 pm

There is no reference to jquery in the page.

- open the HTML object
- click 'Resources'
- copy/paste:

Code: Select all

$JQUERY$

Sergio Morais
 
 
Posts: 37
Joined: Wed Aug 14, 2013 3:55 pm

Re: Layer or object appear only once per browser session

Post by Sergio Morais » Tue Jun 12, 2018 4:41 pm

Thanks Pablo,

But I'm that even after these last instructions, still no cookie creation...

Regards,
:cry:

User avatar
Pablo
 
Posts: 13944
Joined: Tue Mar 28, 2006 12:00 pm
Location: Europe
Contact:

Re: Layer or object appear only once per browser session

Post by Pablo » Tue Jun 12, 2018 4:54 pm

The code is now incorrect

Code: Select all

  if (document.cookie.indexOf("newsletterCookie=true")<0) 
    {
        $("#newsLetterPopup").dialog("open");
    }
    $("#newsletterCheckBox").change(function () 
    {
       document.cookie = "newsletterCookie=true; expires=Fri, 31 Dec 9999 23:59:59 GMT; path=/";    
       $("#newsLetterPopup").dialog("close");
    });

Sergio Morais
 
 
Posts: 37
Joined: Wed Aug 14, 2013 3:55 pm

Re: Layer or object appear only once per browser session

Post by Sergio Morais » Tue Jun 12, 2018 5:25 pm

The thing is, I have copy/pasted the html box directly from your corporate template and even used the same object names...

Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests