Developer forum

Forum » Templates » DwExtranet Action

DwExtranet Action

Per Ljung
Reply
Hi!

In my Ecom webshop I want all users to be able to see the products, but only logged in users should see the prices. When using the extranet module, do you need to restrict access to a certain page to use the module, or can you just create a page with a paragraph with the Extranet module attached and in that paragraph use the DwExtranet tags?

I got an error showing that a dangerous value had been submitted when I did this way.

Best regards,
P

Replies

 
Nicolai Høeg Pedersen
Reply
You do not need to do anything but this in your product list and detail template:

<!--@If Defined(Global:Extranet.UserName)-->
       	<!--@Ecom:Product.Price-->
<!--@EndIf(Global:Extranet.UserName)-->


 
Per Ljung
Reply
You do not need to do anything but this in your product list and detail template:

1
2
3
<!--@If Defined(Global:Extranet.UserName)-->
        <!--@Ecom:Product.Price-->
<!--@EndIf(Global:Extranet.UserName)-->


Ok, thanks. But my real problem is that I wonder if there's possible to create a login form without having to restrict access to a page?
 
Per Ljung
Reply
You do not need to do anything but this in your product list and detail template:

1
2
3
<!--@If Defined(Global:Extranet.UserName)-->
        <!--@Ecom:Product.Price-->
<!--@EndIf(Global:Extranet.UserName)-->


And another question from another thread is that how you implement the logic above using xslt?

Best regards,
P
 
Rune Skovbo
Reply
Hi there

It is indeed possible to create a simple loginform without restricting access to a page.
It can be done like this:
<!--@If Not Defined(Global:Extranet.UserName)-->
    <!--@Include(../../Extranet/LoginForm.html)-->
<!--@EndIf(Global:Extranet.UserName)-->

<!--@If  Defined(Global:Extranet.UserName)-->
    Content
<!--@EndIf(Global:Extranet.UserName)-->

Or this:

<!--@If Not Defined(Global:Extranet.UserName)-->
    <form name="ExtUserForm" method="post" Action="" onSubmit="return checkform();">
        Brugernavn<br /><input type="Text" name="Username" value="">
        <br />   
        Kodeord<br /><input type="Password" name="Password" value="">
        <br />   
        <input type="submit" value="login" class="button">
     </form>
<!--@EndIf(Global:Extranet.UserName)-->

BUT, in order to make some things work, like errormessages and the option to get the password sent to you, you do however need to restrict access to a page.

BTW Nicolai, is there some technical reasons why "a full login form" is not possible on paragraph level?

/Rune

 
Nicolai Høeg Pedersen
Reply
Hi Rune.

No - not a good reason any ways.

It is already in the plans to "free" the login from a protected or specific page so anything you can do with login in the login template can be done globally from any template.

It will be released with 8.0

 
Per Ljung
Reply
Hi there

It is indeed possible to create a simple loginform without restricting access to a page.
It can be done like this:
<!--@If Not Defined(Global:Extranet.UserName)-->
    <!--@Include(../../Extranet/LoginForm.html)-->
<!--@EndIf(Global:Extranet.UserName)-->

<!--@If  Defined(Global:Extranet.UserName)-->
    Content
<!--@EndIf(Global:Extranet.UserName)-->

Or this:

<!--@If Not Defined(Global:Extranet.UserName)-->
    <form name="ExtUserForm" method="post" Action="" onSubmit="return checkform();">
        Brugernavn<br /><input type="Text" name="Username" value="">
        <br />   
        Kodeord<br /><input type="Password" name="Password" value="">
        <br />   
        <input type="submit" value="login" class="button">
     </form>
<!--@EndIf(Global:Extranet.UserName)-->

BUT, in order to make some things work, like errormessages and the option to get the password sent to you, you do however need to restrict access to a page.

BTW Nicolai, is there some technical reasons why "a full login form" is not possible on paragraph level?

/Rune

Okay. Well the the reason that I want to create a standalone loginform is because when I restrict access to a page the menu is gone too. I want to restrict access to a page + showing the xslt menu in that page. Is this possible?

Best regards,
P
 
Rune Skovbo
Reply
Can't you put your logo, navigation, footer and all thats not directly editable on your master template? That should solve it.

/Rune

 
Nicolai Høeg Pedersen
Reply
Hi Per

When restricting access to a page you can decide if the navigation item should be shown in menu or not:
http://manual.dynamicweb-cms.com/Dynamicweb-On-line-Manual/Modules/Users/Page,-module-and-paragraph-permissions.aspx

set the "Show this page in menu" to "For all users". Then the navigation item will be shown, but when clicked it prompts for username and password.

 
Per Ljung
Reply

Yes, it works, thanks. Actually the menu doesn't not consist of the pages, but the Ecom product groups.

Best regards,

Per

 

You must be logged in to post in the forum