Sitemap and costum topics

10 years ago
hi !!
I have some repetitive content in my web site pages (Menu - Facebook and tweeter link bloc etc.)
My solution is inserting my content into topic and include them in my web site pages.
but i have problem with site map page. It displays correct page (About us, contact etc.) and also my other topic used as bloc of content (face_tweet bloc, news bloc etc.).

I have this idea but i'm not sure it's the best that i can do.
1- Disable Sitemap.topics
2- Define Sitemap.OtherPages as (About us, History, Contact, etc)  
3- Add an URL rewriting

Thank you for your help ;)
10 years ago
I found an other solution :
1- Naming my topic content bloc as BlockTitleOfMyBlock (Sample :  BlockSocialNetwork, BlockNews, BlockServices etc.)
2- Change ~\NopCommerceStore\Sitemap.aspx.cs  

private void WriteTopics(StringBuilder sb, TopicCollection topicCollection)
        {
            foreach(Topic topic in topicCollection)
            {
                LocalizedTopic localizedTopic = TopicManager.GetLocalizedTopic(topic.TopicId, NopContext.Current.WorkingLanguage.LanguageId);
                if (localizedTopic != null)
                {
                    //----- FILTER BLOCK TOPIC WHEN DISPLAYING SITEMAP ;)
                    if (!localizedTopic.Title.ToString().Contains("Block"))
                    {
                        sb.AppendFormat("<li><a href=\"{0}\">{1}</a></li>", SEOHelper.GetTopicUrl(localizedTopic.TopicId, localizedTopic.Title), (String.IsNullOrEmpty(localizedTopic.Title) ? localizedTopic.TopicId.ToString() : Server.HtmlEncode(localizedTopic.Title)));
                    }
                }
            }
        }


3- Rebuild
4- Copy your NopCommerceStore bin file

Let me know if you have better solution ;) Thank you