How to show a DNN module in a Fancybox pop up?

﹥>﹥吖頭↗ 提交于 2019-12-11 15:38:57

问题


I have a custom DNN registration and login module which I would like to pop up in a fancybox when someone clicks on the sign in to buy (Add to Cart) button.

Firstly, it would show a login and registration button in the pop up. After someone has clicked on one of these buttons, the fancybox should stay open without any postbacks and show the custom DNN modules. Would I perhaps be able to achieve this with Knockout.js?

Currently, the button would add the product to your cart and redirect you away from the page to the login/registration page.

I would like the user to stay on the product page without ever leaving it.

I am thinking of adding the login and registration module to the products page and hiding the view.ascx and somehow make it pop up once the sign in to buy button has been clicked.

How can I make the Login/Registration module in the Fancybox do a postback? Should I use Ajax? Would the popup stay open?

Someone would probably suggest I use the DNN Modal but is it mobile friendly as a fancy box pop-up?

UPDATE

I have asked another question regarding the use of other existing modules in a new module: How can I import an existing DNN module into a new module without copying the existing code?


回答1:


You can use the built in login module, and simply place it inside the modal. The login module by default will simply log users in on the current page, therefore you wouldn't need to worry about the postback. I've used Bootstrap for the modal to accomplish this and it works fine.

If you needed the postback, to take users to a different page after having logged in, you could add the ?returnurl= query string. Just make sure that the query string is already "applied" before the users actually login.



来源:https://stackoverflow.com/questions/54422453/how-to-show-a-dnn-module-in-a-fancybox-pop-up

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!