Skip to content

Commit ec8235b

Browse files
committed
Fixed #856 Return 404 only when topic is rendered as widget
1 parent 0e6afa4 commit ec8235b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/Presentation/SmartStore.Web/Controllers/TopicController.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ protected TopicModel PrepareTopicModel(string systemName)
6666
MetaDescription = topic.GetLocalized(x => x.MetaDescription),
6767
MetaTitle = topic.GetLocalized(x => x.MetaTitle),
6868
TitleTag = titleTag,
69-
};
69+
RenderAsWidget = topic.RenderAsWidget
70+
};
7071
return model;
7172
}
7273

@@ -79,7 +80,7 @@ public ActionResult TopicDetails(string systemName)
7980
var cacheKey = string.Format(ModelCacheEventConsumer.TOPIC_MODEL_KEY, systemName, _workContext.WorkingLanguage.Id, _storeContext.CurrentStore.Id);
8081
var cacheModel = _cacheManager.Get(cacheKey, () => PrepareTopicModel(systemName));
8182

82-
if (cacheModel == null || !cacheModel.IncludeInSitemap)
83+
if (cacheModel == null || (cacheModel.RenderAsWidget && !cacheModel.IncludeInSitemap))
8384
return HttpNotFound();
8485

8586
return View("TopicDetails", cacheModel);

src/Presentation/SmartStore.Web/Models/Topics/TopicModel.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,7 @@ public partial class TopicModel : EntityModelBase
2121
public string MetaTitle { get; set; }
2222

2323
public string TitleTag { get; set; }
24-
}
24+
25+
public bool RenderAsWidget { get; set; }
26+
}
2527
}

0 commit comments

Comments
 (0)