WeBlog creating own template for Entry - sitecore

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.
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?
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>

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.

Related

Sitecore ECM 2.1 - branches, sublayouts and dynamic datasources

It's my first time implementing Sitecore ECM feature. I've cut up some html templates into layouts and sublayouts, created the datasources I needed, and made a branch template with the $name item set to be of template "AB Testable message".
Following Frank Rooijen's blog post: http://www.newguid.net/sitecore/2013/building-custom-newsletter-templates-for-sitecores-ecm-2-x/ I've set the body field in the $name to go to my message root child, set all the sublayout datasources to the relevant child items of the message root.
Andit all works fine!
What I really want to know is how the sublayout's datasource paths are derived to their new location after being instantiated from the create/insert action from the ECM Speak page.
I've been using reflector to try and get some insight, but I don't think I'm looking in the right places.
The ECM package adds a new config file at /App_Config/Includes/Sitecore.EmailCampaign.config. Within that file you can see some new event handlers are added, most notably:
<event name="item:added">
<handler type="Sitecore.Modules.EmailCampaign.Core.ItemEventHandler, Sitecore.EmailCampaign" method="OnItemAdded" />
</event>
<event name="item:copied">
<handler type="Sitecore.Modules.EmailCampaign.Core.ItemEventHandler, Sitecore.EmailCampaign" method="OnMessageCopied" />
</event>
If you decompile Sitecore.EmailCampaign.dll and look at the corresponding Class and follow through the code you will see call to MessageRelationsCorrector.CorrectItemRelations() which handles all the work to replace the IDs of the DataSources of new created and copied messages.
jammykam is spot on.
The one thing that I'd add though (after banging my head for a while) is that even though the processing first does a check on template descends from AB Testable Message or the other email types, the actual correction of item relations only happens if the email template is exactly one of the built-in templates like AB Testable Message. Don't try and have you own template that derives. Sigh.

How is a custom Sitecore ContentSearch index created?

As the titles states, how is a custom Sitecore ContentSearch index created? I end up with [ConfigurationErrorsException: Index has no configuration.]
Sitecore.ContentSearch.LuceneProvider.LuceneIndex.Initialize() +374 each time I try to add in a custom index.
EDIT:
Looking for a basic sample standalone configuration. Copying / Pasting sitecore_master_index or sitecore_web_index indexes results in the error.
This problem occurs because sitecore_master_index and sitecore_web_index configuration do not contain <Configuration> section.
Add in those indexes definition following node and you should not get this error
(*Sitecore.ContentSearch.Lucene.Index.Core.config, Sitecore.ContentSearch.Lucene.Index.Master.config,
Sitecore.ContentSearch.Lucene.Index.Web.config*):
<Configuration ref="contentSearch/configuration/defaultIndexConfiguration"/>
I don't know why it is like that, but it looks like Sitecore's provided index samples do not like it when you try to add your own custom index configuration.
Have a look at Autohaus on Github. Its a custom Sitecore website built by Alex Shyba and Tim Ward. It has a custom index in there to search all the vehicles so you should be able to follow that and see how its done.
On an overview, they have created a new config and referenced the new index name and created an ISearchIndex object using Sitecore.ContentSearch.ContentSearchManager.GetIndex("index_name");. How are you creating your ISearchIndex object?

Umbraco error in Document Types

A long time ago I first setup a website in Umbraco. This seemed to be working fine.
I have now come back to it about a year later, and was initially getting the following error when selecting a Document Type (any document type in the Settings tab):
A bit weird, because earlier I didn't have this issue, but fine. I do what it says, and add <identity impersonate="true"/> to the <system.web> node in web.config.
While it does fix the initial issue, I now have the following on all document types:
When trying to create a new Document Type, I get the same kind of error, but then the ReturnUrl part is ReturnUrl=/umbraco/create.aspx?nodeId=init&nodeType=inittemplates&nodeName=Templates&rnd=20.2&rndo=21.2&nodeId=init&nodeType=inittemplates&nodeName=Templates&rnd=20.2&rndo=21.2' - but only if I tick the box 'Create template for this item'. The same happens when I try and create a Template.
After Googleing I came up with this: our.umbraco post with similar issue. One (unconfirmed) solution is that there's an illegal name in a document type/ template - but I haven't changed anything, and might be fixed by going into the database.
I did check the /masterpages folder, the only 'strange' characters in there are - and _.
In my Document Types I have on named 'Textpage (Two col)' and another named 'News & Events list'. I'm a bit hesitant to just delete them, since I don't have enough Umbraco knoledge to be sure this will fix my issue...
Is there any known solution for this, or will I also have to go into the database (and if so, whereabouts?)
I'm running Umbraco 4.7.2, assembly version 1.0.4500.21031.
I've hosted this site with GoDaddy.com - I don't know if that would be relevant.
[Update 1]
As per Tom Maton's comment:
The requirepermissions should be set to false, and have been.
in Appsettings I've set this:
<add key="umbracoUseMediumTrust" value="true" />
And I've added Trusted_Connection=yes to the connectionstring.
the problem remains.
[Update 2]
Tried the solution amelvin provided, but no dice. Doctypes and templates still give the error. I'm getting more certain it's some security issues. Which folder would correspond to the Templates? Would that be the masterpages folder? If so, what kind of permissions does that one need?
It could be that you don't have full trust on your Go Daddy environment?
Check this post out http://our.umbraco.org/forum/getting-started/installing-umbraco/17856-Umbraco-on-GoDaddy-Shared-Hosting
Could help resolve your issue.
The error could be a knock on from permissions errors as yet unsolved.
But the error is thrown if the content page does not have a template assigned or if Umbraco thinks it doesn't have a template. If absolutely nothing has changed to the site then it could be that the umbraco.config file has somehow got corrupted (it will contain all the doctype/template cross reference info). This can be fixed by right clicking on the top 'content' node and choose 'republish entire website'.
Secondly navigate to the settings | document types (if you can now) and check the templates dropdown on the first tab of the appropriate document type. If its set to 'please select' then this error will get thrown when any page tries to render without a valid template assigned. If a default template is assigned - then go to that template and re-publish it - Umbraco may have lost it.
If this does not work then check if the template is assigned properly. Go to the same place in the content tree as the problem page and try to add a node with the desired doctype. If no choices are offered then it could be that the parent tab no longer allows the correct doctypes as children nodes, so go back to the doctypes and check the allowed children (second tab) of the parent node.
If none of this works without odd errors being thrown then its a mystery!
Here are a list of Permissions required for Umbraco http://our.umbraco.org/wiki/reference/files-and-folders/permissions
Or you could use one of the steps below to check all the folder permissions.
http://our.umbraco.org/wiki/reference/files-and-folders/permissions/perform-permissions-check
Or install this package. http://our.umbraco.org/projects/backoffice-extensions/ugolive this will allow you to check the permissions are correctly setup.

Magento - catalog.xml not using correct template

Noob developing a Magento theme and I can't seem to figure out why Magento is not using the path I specify in the setTemplate action on catalog.xml.
I've got my own theme in /app/design/frontend/default/mycustomtheme and I've been patching files over from the base and making changes.
I've copied over /app/design/frontend/base/default/layout/catalog.xml to my custom theme at /app/design/frontend/default/mycustomtheme/layout/catalog.xml. I've set the template to be a specific phtml file...
<catalog_product_view translate="label">
<label>Catalog Product View (Any)</label>
<!-- Mage_Catalog -->
<reference name="root">
<action method="setTemplate"><template>page/2column.phtml</template></action>
</reference>
Yet it's not working. Can someone spot what the problem might be? I've got all cache disabled and other changes I make I can see immediately, just not this one.
edit: I should note, if I change something else in the catalog_product_view xml node I see those changes are reflected. For instance if I remove <action method="addJs"><script>varien/product.js</script></action> then I see the reference is removed in the rendered html file.
edit2: Adding images to address questions ...
did you setup-up / configured the theme from your store backend?
Yes, and it's actually loading the correct header and footer, and it's properly styled.
Are you sure you have such template under /app/design/frontend/default/mycustomtheme/template/page/ directory?
Yes, I can confirm the file is there
OMG. The (one and only) product I was testing on had a specific layout set under the "Design" section. So I guess that was overriding anything I had set in catalog.xml
I'd like to have the 3 hours of my life back.

Sharepoint 2007 AddList and AddListFromFeature are missing template columns and data content

What I've Done
Inside SharePoint I created a List based on the Project Tasks template
I deleted most default columns, and added new custom columns
I added data using the new format
Then I did a "Save as template" and chose to save the template with the content
What IS Working
Now, when I use that template to create a new List inside of SharePoint it works perfectly. The custom columns are present, and the data is all pre-filled as expected.
What ISN'T Working
However, when I use the AddList or AddListFromFeature methods made available by SharePoint web services the new list is created, but it is simply based off of the original Project Tasks template with the default columns and no data!
What I've Tried
I tried following the suggestion in the article from Phase 2 to setup a custom template ID, but that only prevented me from using the template at all (was no longer listed when I do a "Create").
I'm still trying to figure out if this article applies - it seems to be a similar issue, but applied to Sites instead of Lists.
I found that another person was having the same problem about a year ago.
System Setup
Working with SharePoint 2007 (I think?), using PHP with NuSOAP to connect. The connection is definitely working as I've added items to lists, created lists, and read data.
Code Samples
Request - against Phase 2 Method template above
<?xml version="1.0" encoding="ISO-8859-1"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2034="http://tempuri.org"><SOAP-ENV:Body>
<AddListFromFeature xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<listName>2Test Milestone Release</listName>
<description>Testing this out</description>
<featureID>{00BFEA71-513D-4CA0-96C2-6A47775C0119}</featureID>
<templateID>151</templateID>
</AddListFromFeature></SOAP-ENV:Body></SOAP-ENV:Envelope>
Response - fails due to templateID not being recognized
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.</faultstring><detail><errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/">Cannot complete this action.
Please try again.</errorstring><errorcode xmlns="http://schemas.microsoft.com/sharepoint/soap/">0x81072101</errorcode></detail></soap:Fault></soap:Body></soap:Envelope>
I'm stumped! So if you can help - I'd be a very happy person! Thanks, in advance!
I would chase why you can't create the list via the interface in the first place, these two web service calls don't seem to include the important parameter when creating from custom templates, lets analyse the querystrings:
New Project Tasks (out of the box)
http://site/_layouts/new.aspx?FeatureId={00bfea71-513d-4ca0-96c2-6a47775c0119}&ListTemplate=150
New Project Tasks Custom (saved in the list template gallery)
http://site/_layouts/new.aspx?CustomTemplate=PT6.stp&FeatureId={00bfea71-513d-4ca0-96c2-6a47775c0119}&ListTemplate=150
New Project Tasks Custom (manifest.xml edited to 151)
http://site/_layouts/new.aspx?CustomTemplate=PT6.stp&FeatureId={00bfea71-513d-4ca0-96c2-6a47775c0119}&ListTemplate=151
They all work, so my take here is that the Web Service is a no no for custom templates, or it has some secret magic (common in list definitions) since specifying only the ListTemplate without being explicitly CUSTOM won't work even in the UI.
If you can't get around with this apparent limitation, my suggestions are:
.NET, note that this post has some voodoo in the first comment if you happen to get the same error
Make an IFRAME with http://site/_layouts/new.aspx?CustomTemplate=PT6.stp&FeatureId={00bfea71-513d-4ca0-96c2-6a47775c0119}&ListTemplate=150 as source and fill the fields using javascript, and then trigger the OK button click, make some full page loading transition and it will even look good.
Method 2 needs to be done from the same domain, if you are not running your PHP from the same domain (unlikely) you need to create a page inside the SharePoint site to contain this hack, it can be as simple as a Web Part Page with a Content Editor Web Part in it, you read some querystring parameters, place them on the fields, trigger the OK and wait for the page to change so you can redirect to a "success" page.
Edit: I got curious and looked at the source of New.aspx, it has this little snippet (bIsCustomTemplate = strCustomTemplate != null, strCustomTemplate = querystring "CustomTemplate"):
<% if (bIsCustomTemplate) { %>
<input id="onetidCustomTemplate" type="Hidden" name="CustomTemplate" value=<%SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(strCustomTemplate),Response.Output);%> />
<% } %>
I looked at the disassembled code but I don't think we can post it here, but it only proves that the UI builds it from a post (Request.Form) and looks for the CustomTemplate parameter, and the Web Service has only those methods were you can't specify a custom template.