Jump to content

Modifying the example plugin


Fidde

Recommended Posts

Posted

So I followed the example plugin, but I have a question.

How do I force the temple to use the setting "Replace the chosen element(s)." When there is content to display and either use the "Insert content inside the chosen element(s), at the start." (so that it doesn't show when clicked) or simply hide it all together.

What I want to achieve is this (before you click, no access to the content of the site):

a9c47de0a1cd5fd097599aa3447b93af.png

And after they've accepted, they get the normal site:

a03dbcfa35ef2c396ca30c7b8f5833f1.png

 

  • 1 month later...
Posted

Probably the way I'd go about what you are after is

  1. If the user visits the site and has not accepted, show the box you have now
  2. Clicking accept sends to a special URL that either sets a cookie or sets a property for the member in the database to flag they've accepted
  3. Redirect user back to the page, and when the page loads since they've now accepted, show it normally

 

You don't need to really get into difficult or complex plugin capabilities that way.

  • 4 weeks later...
Posted
On 2016-04-08 at 3:57 AM, bfarber said:

Probably the way I'd go about what you are after is

  1. If the user visits the site and has not accepted, show the box you have now
  2. Clicking accept sends to a special URL that either sets a cookie or sets a property for the member in the database to flag they've accepted
  3. Redirect user back to the page, and when the page loads since they've now accepted, show it normally

 

You don't need to really get into difficult or complex plugin capabilities that way.

If there is a simple way of doing this I haven't found it, could you guide me in some kind of direction on how to do this? ^_^

Posted

You'd just write two plugins as I see it. One would check if the cookie/flag is set, and if not show the form with a link to a special URL. Then another plugin would act on that special URL when visited to set the cookie/flag and send the user back.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...