Login rewrite not working

Following instructions to get a LOGIN / LOGOUT / DAHSBOARD setup working.

The Login and Logout work great, each disappears when no longer appropriate, but I want the LOGIN to be ‘re-written’ to read ‘DASHBOARD’ or something similar.

Using the instructions on the ‘Navbar’ tab of ‘Forms and Fields’ isn’t working - Though it isn’t the rewrite as such but rather the LOGIN element is not displaying.

Inspecting page code reveals when logged in the LOGIN element is set to ‘display:none;’ and the ms-rewrite is functioning correctly, as removing ‘display:none’ makes everything work as expected. Just not sure how to remove the auto display:none; that Memberstack performs when logged in!

Cat

Hmmm yeah ok so now a little confused. I’ve forced the Login/Dashboard link to show by giving it an ID tag of ‘login-dash’, then used Project custom code:

#login-dash {display:block !important;}

That makes it work! But the link it has when ‘re-written’ is …/ms/login

So where is it actually supposed to take the logged in user?

Here is what is says under the 'Re-write section:

Rewrite your login link

After logging in, MemberStack will swap the login link with a link to your members only area. What do you call your members only area?

So what does it mean by your ‘Members Only area’? This would probably be different for each Member plan…

I think I will make a third custom link/button and direct it where I want it to go ie. to My custom user-personalised Dashboard — but I’d really still like to understand how this is supposed to be working, in case I could be making use of something useful!!

Cat

Hey Cat!
Do you have a url I can look at? Or possibly some images? Trying to fully understand. :slight_smile:

Hi @Josh-Lopez I just created anothee button which is only viewable by members, solves the issue.

It did start working by itself though, felt like maybe Webflow wasn’t updating despite publish, then next time I checked it worked. A JScript thing I guess.

I still had the issue of not knowing how to make the rewritten button change its link as well, so my new solution is nicer. Cheers

1 Like

I’m having the same issue as Cat.

The same issues are appearing:

  1. the log in link is set to ‘display:none’ once user is logged in
  2. the link (which is hidden because of display:none) is pointing to /ms/login anyways, which isn’t right

Here is a link to my project: https://turnturn-dressing-room.webflow.io/shopping-page

user: test@test.com
p: testtesttest

Hey Danial!
Trying to understand more. Where is the link supposed to go?
Also have you seen this page? https://help.memberstack.io/post/hide-content-on-a-page

Josh

I followed instructions to the letter. What eventually worked was nothing I did, it seemed as though something took its sweet arse time updating, probably a Webflow issue if I had to guess

I redid everything anyways even after it worked, and the next time there was no waiting involved!

1 Like

The link ( https://turnturn-dressing-room.webflow.io/shopping-page ) is supposed to go to my website. I just have it parked at a generic domain for now.

To reproduce the issue:

  1. go to my website
  2. click “Log in”
  3. log in using test@test.com as the username and testtesttest as pw
  4. Note how the “Log In” element disappears entirely, the brand logo shifts to the left, and if you inspect the page you’ll find the following element: < a data-ms-rewrite=“Profile” href="#/ms/login" class=“link-2” style=“display: none;”>Profile</a

The “display:none” above is the issue here.

Note, my website currently uses the same workaround that Cat used, which is to have an entirely different button (which for now, I’ve placed slightly below and named “My Profile”).

Hey @danial don’t know if this helps or not buy this is how Mine’s set up.

I have a ‘member only content’ thingo which has a profile page URL content lock.

Then every membership is enabled for access to this page within each individual membership plan’s settings.

Then is set the ‘profile’ button in my navigation to the appropriate ‘hide content’ attributes which are shown at the far right of the ‘member only content’ relating to that which I’ve made available to all members.

So it’s only visible to members, and disappears when not logged in.

I’ve never been able to get the rewrite function to work.

1 Like

a quick solution Danial would be to use visibility: hidden; instead of display: none;

whats happening is you are removing the element from the flexbox and thats causing the shifting. :slight_smile:

Hey Cat,

I can check out whats going on with the rewrite if you let me see it by providing a link :slight_smile:

Thanks Josh. Were you able to reproduce the issue on my site?
The point is that any attempt to use the ‘rewrite’ attribute is forcing the “display:none” problem.

Thanks, I’ll give this a try

ah ok i wasnt sure if you added the display none. With that known now what i would do is add more divs in the navbar so when the element is removed the parent div would still have the same width.

Yes @danial exactly what I experienced, everytime I used rewrite I couldn’t stop the element from being display:none

@Josh-Lopez he’s not applying display:none Memberstack is doing that I think. It’s really hard to know whether MS or WF is causing this though.

But either way @danial I now believe that the better way is to not use rewrite at all. Simply make a new element button called ‘profile’ or ‘dashboard’ and give it an attribute like ‘content-allmembers’ with the data-ms-content (or whatever it is).

So I think to do this you’d have your profile page URL protected by an extra ‘member only content’ setting in the ‘memberships’ tab in MS. Then in every membership plan you have, enable access to the profile page URL.

Now all membership plans will be allowed to view elements with the attribute data-ms-content / content-allmembers - which you’ve set the button element to.

Thanks Josh. The trouble is that that doesn’t solve the main issue: the ‘Profile’ button still does not appear (as it is supposed to after the ‘rewrite’ attribute kicks in).

@danial are you willing to try my solution? It actually gives you even more control over the ‘profile’ button than using rewrite…

1 Like

@danial did you put in a url for the link in the editor like href="#/ms/login", or did you just put the attribute data-ms-rewrite=“Profile” in for the button? The way it works almost like its being forced to the login.

Thanks @cathughesxo, I used your solution. I used ‘ms-profile=“true”’ to show the ‘Profile’ button only to users.