3

I am using Sitecore 7.2 and weblog 2.3.

I have a blog with couple of Entries, the posts show up fine. I am trying to create a Custom Template "CustomEntry" that inherits "Entry"

I followed all the steps from the link https://github.com/WeTeam/WeBlog/wiki/Template-Settings. The Blog is now completely empty. While debugging, it appears that GetBlogEntries() is empty. I believe this is an Index related issue. There are couple of things unclear to me.

  1. When creating a new template for Entry, I understand that I should inherit Entry. I have inherited both Entry and StandardTemplate and sorted the Entry to be above the Standard Template. Is this what I am supposed to do?
  2. In the following code, what should be "", Should it be the Blog template that I am using. in my case CustomEntry? I understand that the value should be the ID for "CustomEntry" Template.
<locations hint="list:AddCrawler">
  <master type="Sitecore.Modules.WeBlog.Search.Crawlers.DatabaseCrawler,Sitecore.Modules.WeBlog">
    <include hint="list:IncludeTemplate" entryTemplate="$(EntryTemplateID)" commentTemplate="$(CommentTemplateID)">
      <myEntry>{D5608C5D-45E4-43FA-B2E4-DCD9DDF3E5A1}</myEntry>
      <myComment>{C85123CF-DA89-4C37-ACFA-4F8BA5157AC1}</myComment>
    </include>
  </master>
  <web type="Sitecore.Modules.WeBlog.Search.Crawlers.DatabaseCrawler,Sitecore.Modules.WeBlog">
    <include hint="list:IncludeTemplate" entryTemplate="$(EntryTemplateID)" commentTemplate="$(CommentTemplateID)">
      <myEntry>{D5608C5D-45E4-43FA-B2E4-DCD9DDF3E5A1}</myEntry>
      <myComment>{C85123CF-DA89-4C37-ACFA-4F8BA5157AC1}</myComment>
    </include>
  </web>
</locations>
Jan Bluemink
  • 3,467
  • 1
  • 21
  • 35
Afroz
  • 1,017
  • 2
  • 12
  • 24

1 Answers1

3

Yes, you should create 3 templates each one will inherit from either BlogEntry, BlogCategory or BlogComment:

/sitecore/templates/Modules/WeBlog/BlogEntry /sitecore/templates/Modules/WeBlog/BlogCategory /sitecore/templates/Modules/WeBlog/BlogComment

The settings listed in the snippet are for the search index which you have setup on the master and web indexes.

These settings should be the template IDs of your new templates that inherit from the builtin templates. The names of the tags "myEntry" or "myComment" can be called whatever you like and only the Guid will be read from these tags.

<myEntry>{D5608C5D-45E4-43FA-B2E4-DCD9DDF3E5A1}</myEntry>
<myComment>{C85123CF-DA89-4C37-ACFA-4F8BA5157AC1}</myComment>

I would try rebuilding the search index called weBlog to see if this fixes the issue.

You have to make sure that you have blog entries published that are based on the new templates you have created.

You could use Luke -https://code.google.com/p/luke/ to examine the Sitecore indexes /data/indexes to see if you are getting blog items in your index.

Ian Graham
  • 3,206
  • 1
  • 15
  • 23
  • I have created only template that inherits from BlogEntry. I am guessing this shouldn't affect the results. The part where I was confused is the xml tag myEntry itself. do myEntry and myComment mean something to weblog settings? I did rebuild the index. I also tried modifying the weblog.config itself to see if there is something wrong with the patch settings. No luck. I will examine the indexes in few hours. – Afroz Apr 21 '15 at 15:06
  • the values "myEntry" or "myComment" can be called whatever you want. It should just look at the guid. Did you setup the alternate templates on the Blog object as well? Do you have blog entries that are based on these new templates? – Ian Graham Apr 21 '15 at 15:34
  • Dont forget to "mark as answer" if this answers your quesitons – Ian Graham Apr 21 '15 at 16:27