Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object Preview for Mulit-Site #5462

Open
dpfaffenbauer opened this issue Dec 17, 2019 · 4 comments
Open

Object Preview for Mulit-Site #5462

dpfaffenbauer opened this issue Dec 17, 2019 · 4 comments

Comments

@dpfaffenbauer
Copy link
Contributor

@dpfaffenbauer dpfaffenbauer commented Dec 17, 2019

Is there a specific reason for this?

@dpfaffenbauer

This comment has been minimized.

Copy link
Contributor Author

@dpfaffenbauer dpfaffenbauer commented Dec 17, 2019

I think I just opened the pandora box.... Object Preview doesn't work with multisite anyway, cause pimcore_object_preview disables site resolving and thus the route cannot be resolved :/

@brusch

This comment has been minimized.

Copy link
Member

@brusch brusch commented Dec 17, 2019

Preview can only work on the same hostname -> sessions.

@dpfaffenbauer

This comment has been minimized.

Copy link
Contributor Author

@dpfaffenbauer dpfaffenbauer commented Dec 17, 2019

ok, but how do you work with multiple sites, with different Product Classes and sort of the same routes?

Current Solution is something like this:


    1 => [
        "id" => 1,
        "name" => "agro_product_detail",
        "pattern" => "/(.*?)\\/(.*?)\\~p([0-9]+)/",
        "reverse" => "/%type/%name~p%id",
        "module" => NULL,
        "controller" => "@AgroBundle\\Controller\\ProductController",
        "action" => "detail",
        "variables" => "type,name,id",
        "defaults" => NULL,
        "siteId" => [

        ],
        "priority" => 2,
        "creationDate" => 1501773148,
        "modificationDate" => 1570003888
    ],
    10 => [
        "id" => 10,
        "name" => "bueho_product_detail",
        "pattern" => "/(.*?)\\/(.*?)\\~bp([0-9]+)/",
        "reverse" => "/%type/%name~bp%id",
        "module" => NULL,
        "controller" => "@BuehoBundle\\Controller\\ProductController",
        "action" => "detail",
        "variables" => "_locale,name,id",
        "defaults" => NULL,
        "siteId" => [

        ],
        "priority" => 2,
        "creationDate" => 1501773148,
        "modificationDate" => 1570003888
    ],

only difference is the Identifier at the end of the route, but that is not a viable solution. Routes support usage for certain sites only, but that can never work with Object Preview currently...

@dpfaffenbauer

This comment has been minimized.

Copy link
Contributor Author

@dpfaffenbauer dpfaffenbauer commented Dec 17, 2019

Another solution, separate Routes for preview:

    11 => [
        "id" => 11,
        "name" => "bueho_product_preview",
        "pattern" => "/bueho\\/preview\\~([0-9]+)/",
        "reverse" => "/bueho/preview~%id",
        "module" => NULL,
        "controller" => "@BuehoBundle\\Controller\\ProductController",
        "action" => "detail",
        "variables" => "id",
        "defaults" => NULL,
        "siteId" => [

        ],
        "priority" => 2,
        "creationDate" => 1501773148,
        "modificationDate" => 1570003888
    ],
    12 => [
        "id" => 12,
        "name" => "agro_product_preview",
        "pattern" => "/agro\\/preview\\~([0-9]+)/",
        "reverse" => "/agro/preview~%id",
        "module" => NULL,
        "controller" => "@AgroBundle\\Controller\\ProductController",
        "action" => "detail",
        "variables" => "id",
        "defaults" => NULL,
        "siteId" => [

        ],
        "priority" => 2,
        "creationDate" => 1501773148,
        "modificationDate" => 1570003888
    ],

Where the start of the route actually is the site-root-path. So, I can resolve the theme for it and render it correct.... Still feels a bit tricky though. Shouldn't it prefix the site path for a AdminRequest automatically?

@dpfaffenbauer dpfaffenbauer changed the title parse_url for Object Preview makes multi-site non-working Object Preview for Mulit-Site Dec 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.