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

Use PathBase to support Virtual Directory #6

Conversation

eloekset
Copy link
Owner

Changes to various components to make use of PathBase for IIS Virtual Directories.

The previous functionality has no unit tests and the changes haven't been thoroughly tested. I.e. no multi-site Piranha application has been tested with the changed framework.

The site template also needs a change to make use of the new feature of the Piranha.AspNetCore package. Menu item links must use WebApp.Url(sitemapItem) to generate correct URLs:

<div class="navbar-collapse collapse" id="mobileNavbar">
        <ul class="justify-content-center navbar-nav mr-auto">

            @foreach (var item in WebApp.Site.Sitemap)
            {
                if (!item.IsHidden)
                {
                    <li class="nav-item @(item.Id == WebApp.PageId || item.HasChild(WebApp.PageId) ? "active" : "")">
                        <a class="nav-link" href="@WebApp.Url(item)">@item.MenuTitle</a>
                    </li>
                }
            }
        </ul>
    </div>

Copy link

@tidyui tidyui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SitemapMiddleware should probably be handled differently. Since the IntegratedMiddleware is executed before everything in the RequestHelper should be set. Secondly, it will be more readable if the Sitemap middleware uses the new extension methods for Absolute URLs.

@eloekset
Copy link
Owner Author

Thanks for your feedback! 👍
I’ll take another look at it and see if I understand the middleware flow.

@tidyui
Copy link

tidyui commented Jul 28, 2020

Here you can the order in which the middleware is added!

https://github.com/PiranhaCMS/piranha.core/blob/master/core/Piranha.AspNetCore/AspNetCoreStartupExtensions.cs#L71

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

Successfully merging this pull request may close these issues.

2 participants