Skip to content

Commit

Permalink
Fixed favicon.ico issue with PathBase
Browse files Browse the repository at this point in the history
  • Loading branch information
muratcakir committed Mar 25, 2023
1 parent 3c49102 commit d296578
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions Smartstore.sln
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{5135A2B0
src\Smartstore.Build\Smartstore.Common.props = src\Smartstore.Build\Smartstore.Common.props
src\Smartstore.Build\Smartstore.Common.targets = src\Smartstore.Build\Smartstore.Common.targets
src\Smartstore.Build\Smartstore.Data.props = src\Smartstore.Build\Smartstore.Data.props
src\Smartstore.Build\Smartstore.Data.targets = src\Smartstore.Build\Smartstore.Data.targets
src\Smartstore.Build\Smartstore.Module.props = src\Smartstore.Build\Smartstore.Module.props
src\Smartstore.Build\Smartstore.Module.targets = src\Smartstore.Build\Smartstore.Module.targets
src\Smartstore.Build\Smartstore.Razor.props = src\Smartstore.Build\Smartstore.Razor.props
Expand Down
11 changes: 11 additions & 0 deletions src/Smartstore.Web/Views/Shared/Components/Favicon/Default.cshtml
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
@model FaviconModel

@{
var hasIcon = false;
}

@if (Model.FavIconUrl.HasValue())
{
hasIcon = true;
<link rel="shortcut icon" href='@($"{Model.FavIconUrl}?v={ SmartstoreVersion.CurrentVersion}")' />
}

@if (Model.PngIcons.Count > 0)
{
hasIcon = true;
<!-- png icons -->
foreach (var icon in Model.PngIcons)
{
<link rel="icon" type="image/png" sizes="@icon.Size" href="@icon.Url" />
}
}

@if (!hasIcon)
{
<link rel="shortcut icon" href='@Url.Content("~/favicon.ico")' />
}

@if (Model.AppleTouchIcons.Count > 0)
{
<!-- Apple touch icons -->
Expand Down

0 comments on commit d296578

Please sign in to comment.