Conditional Statements
-
Hi, I have a challenge I am struggling with and am hoping for some ideas if this can’t be solved with conditional statements.
With the use of sidebars, I have added menu 1.0 and 1.5 to a series of pages. These pages are steps required to configure a drone before flight.
Here’s the challenge, there are roughly 12 configuration steps.
– Some steps are different for drone 1.0 and 1.5 so say “step 1” has a page for each drone. This makes the use of the sidebar menu easy to implement.
– Some steps are the exact same for both drones so say “step 2” is a page used by both drone configurations. This is a problem when user was viewing 1.5 instructions and the page menu defaults to 1.0.I could create duplicate pages but am wondering if it is possible to create conditional statements along the lines of “IF viewing version 1.0 pages display menu 1.0 and IF viewing pages version 1.5 display menu 1.5”.
The other challenge would be when they are viewing the 1.5 section but then view to common pages that default to 1.0.
Any help is appreciated.
The page I need help with: [log in to see the link]
-
Hey @dhsllc,
Hope you’re well.
I didn’t understand is this question, related Custom Sidebars or are you asking generally. But if we are talking about Custom Sidebars plugin you can set sidebars based on pages. So you can create sidebars for two different version and assign them to necessary pages as you wish.
To assign a sidebar to a page, after installing the plugin you need to go to Widgets page and allow the sidebar replaceable;

Then create a new sidebar, go to any page to change sidebar for that page. Lastly, change sidebar from Sidebars meta box;

I hope it helps!
Cheers,
OguzHello @dhsllc,
it’s been a while since we’ve heard back from you, so I mark this topic as resolved. Feel free to post back here, if more assistance is required and we can re-open it and carry on with it! 🙂
Warm regards,
Dimitris
The topic ‘Conditional Statements’ is closed to new replies.