Use specific link in open_link_as_overlay();

Post

Posted
Rating:
#4552 (In Topic #964)
Joe
Avatar
Standard member
Joe is in the usergroup ‘Honoured member’
BLOCK_TOP_LOGIN.tpl displays the "options" link (only viewable to guests) and uses open_link_as_overlay(this); to open a popup overlay allowing the user to set options prior to logging in (such as logging in using FB, etc):

Code

<a &#111;nclick="return open_link_as_overlay(this);" rel="nofollow" href="{FULL_LOGIN_URL*}" title="{!MORE}: {!_LOGIN}">{$?,{$MOBILE},{!_LOGIN},{!OPTIONS}}</a>

I've replaced that with a button tag, but I can't seem to implement the overlay functionality when using a button in place of the default anchor tag. You can't add the href attribute to a button tag, you can't nest the button tag under an anchor tag (and remain standards compliant). The only logical solution I could think of is nesting the button within a form and placing {FULL_LOGIN_URL*} within the forms action attribute, then use onclick="return open_link_as_overlay(this);" on the button. But, all this did when I tried it was reload the main page and completely ignored open_link_as_overlay(this);.

Is there a way to define a specific link within open_link_as_overlay();? Using onclick="return open_link_as_overlay('https://mylink.com');" didn't seem to work either.
Online now: No Back to the top

Post

Posted
Rating:
#4563
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
open_link_as_overlay is just a front-end to faux_open.

onclick="faux_open(some_url);"

Documentation you might read about JavaScript's 'standard' window.open method is mostly applicable to faux_open, which is designed to emulate it for our overlays (instead of new windows).



Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Online now: No Back to the top

Post

Posted
Rating:
#4567
Joe
Avatar
Standard member
Joe is in the usergroup ‘Honoured member’
Doesn't work. :(

When I use faux_open(https://google.com);, I get this error:
1: SyntaxError: missing ) after argument list

If I add single quotes, like: faux_open('https://google.com');, I get this error:
120: TypeError: this.width is null
Online now: No Back to the top

Post

Posted
Rating:
Item has a rating of 5 (Liked by KingBast)
#4568
Joe
Avatar
Standard member
Joe is in the usergroup ‘Honoured member’
Think I've figured it out. I have to manually define the height and width, and add a wide_high=1 to hide the header, but it does the job:

onclick="faux_open('{$PAGE_LINK,:login:wide_high=1}','','width=500,height=500,status=yes,resizable=yes,scrollbars=yes');"
Online now: No Back to the top

Post

Posted
Rating:
#4569
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
Yeah, good job.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Online now: No Back to the top
1 guest and 0 members have just viewed this.

Statistics

Users online:

Salman, ХорошаЯ, deepu_ms, 224 guests

Forum statistics:
  • 886 topics, 4,284 posts, 5,271 members
  • Our newest member is Varundatta
Birthdays:
Back to Top