fix: replace emoji with hero image in blog sidebar doctor card
- Post.cshtml.cs: load hero image, tag from SiteSettings in SetViewDataAsync - Post.cshtml: show <img> with hero image in .doc-avatar when set, fall back to emoji only if no image is configured - .doc-avatar: circular crop with object-fit:cover, gold border - doc-title now uses HeroTag from settings (not hardcoded) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -135,9 +135,12 @@ public class PostModel : PageModel
|
||||
ViewData["ArticleType"] = post.ArticleType;
|
||||
ViewData["Slug"] = post.Slug;
|
||||
|
||||
var s = await _db.SiteSettings
|
||||
.FirstOrDefaultAsync(x => x.Section == "hero" && x.Key == "name");
|
||||
ViewData["SiteName"] = s?.Value ?? "دکتر سوسن آلطه";
|
||||
var heroSettings = await _db.SiteSettings
|
||||
.Where(x => x.Section == "hero" && (x.Key == "name" || x.Key == "image" || x.Key == "tag"))
|
||||
.ToListAsync();
|
||||
ViewData["SiteName"] = heroSettings.FirstOrDefault(x => x.Key == "name")?.Value ?? "دکتر سوسن آلطه";
|
||||
ViewData["HeroImage"] = heroSettings.FirstOrDefault(x => x.Key == "image")?.Value ?? "";
|
||||
ViewData["HeroTag"] = heroSettings.FirstOrDefault(x => x.Key == "tag")?.Value ?? "پزشک عمومی و متخصص زیبایی پوست";
|
||||
}
|
||||
|
||||
// View model for comments
|
||||
|
||||
Reference in New Issue
Block a user