Closed 37Stars closed 1 year ago
This is a great idea! Feel free to fork and and send a PR, I'm happy either with a temp/
or feature/
branch 😃
I have made the code updates, but it requires 1) adding search paths to the Razor View Engine if you want to move the views outside of the \blockgrid\Component folder and 2) modifying the items.cshtml file in the \blockgrid folder. Would you like that information in the readme markdown file?
@37Stars yes please! I'll review one you've opened a PR
Instead of hardcoding the path for views to "/Views/Partials/blockgrid/Components/{contentAlias}.cshtml" or "/Views/Partials/blocklist/Components/{contentAlias}.cshtml", use the Razor Engine to find the view.
Changing line 120 in BackOfficePreviewService.cs:
string partialPath = _razorViewEngine.FindView(controllerContext, contentAlias, false).ViewName;
** I was going to create a pull request, but I was prompted to merge into a branch first and I wasn't sure how you wanted to work with pull requests.