Display different widget based on current page

Is there a way to display a different aspect of a page based on the URL?

So for example, on the homepage, I will have a widget that will activate a filtering action on the work. I, of course, don’t want that on any of the other pages. So in my base twig file, I was conceptually thinking of setting up an if else situation. The tricky part is each page has their own widget. So on the contact page, I’ll have a social media widget and on each of the work detail pages I’ll have taxonomies of the project and tools used in the project.

So in theory, (not proper syntax, just thinking out loud.):

{% if page.url == (’/’) %}
include statement_display widget
{% ifelse page.url == (’/work-detail/’) %}
include statement_display widget
{% ifelse page.url == (’/about’) %}
include statement_display widget
{% ifelse page.url == (’/‘contact’) %}
include statement_display widget
{% endif %}

I have tried many ways that i can think of to accomplish this, not working. Any advice on how to implement this?

There are many ways but for these more complex situations, gantry framework is going to be your best friend: http://gantry.org

This is coming to Grav soon…

Looking forward to try gantry with grav!
As for your conditional display, your reasoning seems right.
Did you try

{% if page.active == page.find(/about) %}
{% include ______.html.twig %}
{% endif %}