Advanced Virtual Pages

Hi Kirby - Family!

I want to achieve the following URL structure:

Generic base page/s
company.com/de/page-1
company.com/en/page-1
company.com/de/page-2
company.com/en/page-2
company.com/de/page-2/subpage-1
company.com/en/page-2/subpage-1

Brand A
company.com/de/brand-a/page-1
company.com/en/brand-a/page-1
company.com/de/brand-a/page-2
company.com/en/brand-a/page-2
company.com/de/brand-a/page-2/subpage-1
company.com/en/brand-a/page-2/subpage-1

Brand B
company.com/de/brand-b/page-1
company.com/en/brand-b/page-1
company.com/de/brand-b/page-2
company.com/en/brand-b/page-2
company.com/de/brand-b/page-2/subpage-1
company.com/en/brand-b/page-2/subpage-1

Virtual pages
Am I right that this can be implemented
with Virtual pages?

Branding
The «Brand A» and «Brand B» pages
should be identical to the
«Generic base page/s». But they should
be extended with «Branding» - stuff
like Brand - Logo, Name etc.

Panel
It would be nice if the brand names
could be added via the Kirby - Panel?

SEO
Are the Virtual pages SEO - friendly?

I am very grateful for every tip
and code examples.

Thanx a lot for your help!

Saludos,

Funkybrotha

If I get this right, then the data exists in Kirby. So what I’d do is use routes that return the base pages and provide the additional data. The question is where does this additional data (the logo etc. )come from? Or is this what you want the user to store somewhere, e.g. in a structure field in the Panel?

URLs, now matter how they are generated, are not per se SEO friendly (whatever that means) or not. It depends on the information you provide to the search machines. If pages that are basically the same and only contain a different logo, are SEO friendly, is somehow questionable - duplicate content?

If your pages are exactly the same (or a minor change such as logo or brandname), on a different URL, this is terrible for SEO and considered a dark pattern where search engines will punish your site for.

Thanx @texnixe and @bvdputte!

Yes, the Generic pages data would already exist in Kirby.
The additional data per brand would come from a structure field.
Is there a Routes - Code example showing my… or a similar case?

@bvdputte thanx for the hint.
I know about the duplicate - content - very dark pattern…
…but for me personally, it is more about the technical challenge
how this scenario could be implemented with Kirby.

If I were to take on your use case (for the technical challenge :stuck_out_tongue_winking_eye:), I’ld probably do this in a route, and not with virtual pages.

I use virtual pages to render news coming from another platform (as JSON) in a Kirby website in production.

As I already said above, a route would be the way to implement this.

Inside your route, you can use $page->render() to render your original page and pass the additional data as parameter to the render method.

Pass data from route to controller:

Fetch data from route in controller:
https://getkirby.com/docs/guide/templates/controllers#arguments-from-page-render-in-route

Hi @texnixe!

¡Muchas gracias!

Funkybrotha

¡Con mucho gusto!