Page children urls in other pages

I feel like this should be simple enough but the solution is eluding me.

I’m setting up a site with projects and a store. The idea is to keep the information for a particular project and the store data that relates to it all together. A single touch point. Right now everything is in a ‘project’ blueprint which has a shop toggle field to filter it in the store.

How would I set it up so I can view and click through the store filtered projects in the store section while keeping the url in the /store/item configuration? (/store/project-1 as well as /projects/project-1). It’s easy enough to display a filtered collection of store items but the children urls point to projects.

I’m wanting to use a single source of content (with children) in two usage scenarios with different page templates and urls.

Suggestions would be most appreciated!

If I understand this correctly, you want to show the same content under two different URLs?

Yes exactly, and use a corresponding page template for each parent/child scenario.

From a SEO perspective, serving the same content under multiple URLs is not a good idea at all.

To change the URLs of the pages, you would need a page model that defines the children of the original projects parent as (virtual) children of the store parent.

Great thank you for the help Sonja, you guys rock!

A quick virtual page follow-up question:
Is there a quick way to associate all the content fields or do I have to do them all like this:

'content' => [
    'title' => $storePage->title(),
    'url' => $storePage->url(),

You can assign the content array:

'content' => $page->content()->toArray(),

Haha yes! As soon as I submitted the question I said, wait a sec…and did the same thing.

Thanks again, and enjoy the rest of the weekend!

1 Like