Conditional if current page slug matches related page slug

I've been brought in to work on a site that was done as a single page so there's only a single entry and all the data has been entered for the home page.

Now they want to add a second page that is very similar to the home page but will have slightly different content. But eventually, the content from the new page will move to the home page too. And then new different content will be added to the second page.

So my thought was, rather than enter the content into the second page, and then have to move it to the home page later, that I'd set it up so that everything is just added for the home page anyway. And I'd add a page relate field to indicate whether a particular block of content should be on the home page, the new page, or both.

So my question is, what should the conditional look like to do that?

I thought it might be something like:

{{ grid_field }}
{{ relate:page_field }}
{{ if slug == current_uri }}
{{ /if }}
{{ /relate:page_field }}
{{ /grid_field }}

But I get no output. What should the conditional look like? Or is there a better way to do what I'm trying to achieve?

>>>>>>> Unanswered <<<<<<<
2 Replies