Skip to content

Commit

Permalink
optional route param for content-item display
Browse files Browse the repository at this point in the history
  • Loading branch information
giannik committed Jun 20, 2024
1 parent 1b095d8 commit 5cf4b17
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class ItemController : Controller, IUpdateModel
_authorizationService = authorizationService;
}

public async Task<IActionResult> Display(string contentItemId, string jsonPath)
public async Task<IActionResult> Display(string contentItemId, string jsonPath, string displayType)
{
var contentItem = await _contentManager.GetAsync(contentItemId, jsonPath);

Expand All @@ -37,7 +37,7 @@ public async Task<IActionResult> Display(string contentItemId, string jsonPath)
return this.ChallengeOrForbid();
}

var model = await _contentItemDisplayManager.BuildDisplayAsync(contentItem, this);
var model = await _contentItemDisplayManager.BuildDisplayAsync(contentItem, this, displayType);

return View(model);
}
Expand Down
2 changes: 1 addition & 1 deletion src/OrchardCore.Modules/OrchardCore.Contents/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public override void Configure(IApplicationBuilder builder, IEndpointRouteBuilde
routes.MapAreaControllerRoute(
name: "DisplayContentItem",
areaName: "OrchardCore.Contents",
pattern: "Contents/ContentItems/{contentItemId}",
pattern: "Contents/ContentItems/{contentItemId}/{displayType?}",
defaults: new { controller = itemControllerName, action = nameof(ItemController.Display) }
);

Expand Down

0 comments on commit 5cf4b17

Please sign in to comment.