Conditional logic on entry id

By: Manuel Diwosch | Asked: 01/13/2023
ForumsCategory: General questionsConditional logic on entry id
Manuel Diwosch asked 2 years ago

Hi, I want to link from one detail page to the next detail page. But I want to do it in a conditional logic: For example: In detail view of entry 66, i want to ad a link like this: [if entry_id equals="x"]LINK[/if]. But I can't get the current entry ID. I tried: [if entry=current equals="X"]LINK[/if] [if entry="X"]LINK[/if]   Does anone has a solution for me? Thanks for help.   Best regards, Manuel

4 Answers
Best Answer
Manuel Diwosch answered 2 years ago
Hi Bobby, thanks for your cooperation. I solved it another way: I exported added a field after survey was finished, exported all data, added value into the right fields and imported new data again. At last entry I imported a higher number. Then I made a conditional logic with if entry number is smaller than X -> then show Link .../[Shortcode-of-field-for X]/... and at the last one if entry number equals why -> then hardcoded Link to overview.
Bobby Clapp answered 2 years ago

Try this:
[frm-set-get detail_entry_id="[id]"]

Then this:
[if get param="detail_entry_id" equals="66"]LINK[/if]

Manuel Diwosch replied 2 years ago

Hi Bobby, thanks for help. But it doesn't do anything. Do you have another idea?

Manuel Diwosch answered 2 years ago
Hi Bobby, thanks for help. But it doesn't do anything. Do you have another idea?
Bobby Clapp replied 2 years ago

Let's break it down. If you add [id] to the view, does it do anything?

Manuel Diwosch replied 2 years ago

Yes, it does. It writes the ID of the entry into the view.

Manuel Diwosch replied 2 years ago

By the way: Thanks for not giving up on me.

Bobby Clapp replied 2 years ago

Ok. Then if we write in [frm-set-get detail_entry_id="[id]"], and then add [get param="detail_entry_id"], is the ID displayed?

Manuel Diwosch answered 2 years ago
No, it is not displayed. I guess it takes no [] inside of other [].. Is this possible?  
Bobby Clapp replied 2 years ago

It should work. How about this one: [frm-set-get detail_entry_id=[id]

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right