Skip Navigation

[Closed] Conditional not work after redirect page

This support ticket is created 3 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 4 replies, has 2 voices.

Last updated by Christian Cox 3 years, 10 months ago.

Assisted by: Christian Cox.

Author
Posts
#2009883
Screenshot 2021-04-04 at 10.26.14 PM.png
Screenshot 2021-04-04 at 10.18.23 PM.png
Screenshot 2021-04-04 at 10.22.44 PM.png

Dear Sir/Madam,

I have a home page, there is a condition setting to show the button

      [wpv-conditional evaluate="false" if="('[wpv-current-user info='id']' eq '')"]
      <div class="buttonDIV">
	      <a href="/tour/[types field='tour-number'][/types]"><button class="50pc">了解詳情</button></a>
    	  <a class="iframe fancybox-iframe" href="/new-application/?tour-code=[types field='tour-number'][/types]"><button class="50p">立即報名</button></a>
      </div>
      [/wpv-conditional]
      [wpv-conditional if="('[wpv-current-user info='id']' eq '')"]
      <div class="buttonDIV">
	      <a href="/tour/[types field='tour-number'][/types]"><button class="50pc">了解詳情</button></a>
          <a href="/wp-login.php"><button>登入報名</button></a>
      </div>
      [/wpv-conditional]

English of 立即報名 is Apply Now
English of 登入報名 is Login and apply

When I login, click the 登入 from the Menu, it redirects me to /my-applications/ page, I click the 首頁 (home page) ,the button shows 登入報名 instead of 立即報名, if I refresh the page, then it correctly shows 立即報名

Is there any wrong setting to my condition?

#2009913
Screen Shot 2021-04-04 at 10.48.15 AM.png

When I login, click the 登入 from the Menu, it redirects me to /my-applications/ page, I click the 首頁 (home page) ,the button shows 登入報名 instead of 立即報名, if I refresh the page, then it correctly shows 立即報名...Is there any wrong setting to my condition?
Hello, I do not see anything obviously wrong in the conditional code. This code seems okay. Is the conditional code included in a View? If so, you may need to disable caching for the View to force it to update after login. If the View is included with a shortcode, you can disable caching directly in the View shortcode like this:

[wpv-view name="your-view-slug" cached="off"]

If the View is included in the Block Editor instead of using a shortcode, you can disable caching when you select the top-level View block in the Block editor. See the screenshot attached here for a visual guide to disable the Views cache.

#2010291
Screenshot 2021-04-05 at 4.25.32 PM.png
Screenshot 2021-04-05 at 4.26.09 PM.png

Dear Christian Cox,

I find the block is not so user-friendly. How can I add the cached="off"? I change the editor to code editor and add the cached="off", when I change it back to the visual editor, it prompts me This block contains unexpected or invalid content, I click the Attempt Block Recovery and the cached="off" gone.

Please advise the proper way to add the parameter to Views.

Best regards,

Kelvin.

#2010309
Screenshot 2021-04-05 at 4.32.15 PM.png

Dear Christian Cox,

I tried to add the cache="off" and redo the steps, no luck. I still got the cached page until I refresh the page and got the correct wording.

Best regards,

Kelvin.

#2011159

Could I log in and see how this process works? I would like to understand how the login works with redirects.

Please provide login credentials so I can see the problem on the live site.

The topic ‘[Closed] Conditional not work after redirect page’ is closed to new replies.