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

Partial page content when ajax #7953

Open
ziic opened this issue Jan 26, 2018 · 2 comments
Open

Partial page content when ajax #7953

ziic opened this issue Jan 26, 2018 · 2 comments
Milestone

Comments

@ziic
Copy link

ziic commented Jan 26, 2018

When request a page (home, for example) with ajax (with http header X-Requested-With: XMLHttpRequest) then I get only partial content of zone "Content". Without wrapped content of Document.cshml and Layout.cshtml

Why? How can I disable such behaviour?

It is reproduced on new clear site (v1.10.1, v1.10.2). "Core" recipe. Disable all modules except "Alias", "Feed", "Containers".

By the way: Feeds and Containers modules for some reason cannot be disabled. When I click "disable" I get nothing.

@carlwoodhouse
Copy link
Member

this is by design (mostly because its unusual to not want just the content via ajax)

Look at Orchard.Core.Contents.Controllers.ItemController int he display method

   var model = _contentManager.BuildDisplay(contentItem);
   if (_hca.Current().Request.IsAjaxRequest()) {
      return new ShapePartialResult(this,model);
    }

You could probably replicate this controller action in your own module and not put that part in ;) or similar

@sebastienros
Copy link
Member

Maybe we could handle a special case with a custom header to keep the theme, that's not really hard to do and not breaking either. Not security issue too I assume.

@sebastienros sebastienros added this to the Orchard 1.10.x milestone Feb 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants