Sitecore 9.0.0 Habitat Installation – Hiccups & Issues

Here I’m documenting the issues occurred during the Sitecore 9 Habitat installation.

HB1.2.jpg

  • Inside settings.ps1. Make sure to update your Sitecore version and Solr Folder.  update the other settings as per your local environment.
    • HB7
    • HB8
  • After Configuring everything, During executing Install.ps1 if you’re getting the below Error ,

Error: Get-LocalGroupMember : Principal IIS APPPOOL\DefaultAppPool was not found

HB1.jpg

then comment the following lines(82 to 89) then execute the Powershell script.

HB2.jpg

  • Install Node.js Software, If you’re not installed already, otherwise you will get the below error. https://nodejs.org/en/

Error:’npm’ is not recognized as an internal or external command,
operable program or batch file.

HB3.1.jpg

Install Node.js

HB3.jpg

After installing node.js. execute the command as per the Getting started instructions. then it will take around 15 minute to complete the Building,Restoring Packages ,Unicorn Sync and Publish.

  • You can either execute the gulp command through CMD Prompt or in visual studio 2017.

HB5.jpg

HB6.jpg

 

Advertisements

Sitecore 9 XConnect 403.16 certificate Installation Issues

Recently did the Sitecore 9 Installation. Post-installation faced the below error Browsing XConnect: Experience Analytics: Sitecore Logs: Sitecore.XConnect.XdbCollectionUnavailableException The issue is because of Sitecore 9 – Untrusted certificates are installed under the Trusted folder, So we have to manually execute the below PowerShell script after Sitecore 9 installation and then restart the machine. Use Powershell […]

Asp.net MVC Ajax File Upload in Sitecore Programmatically using API calls

here I’m going to explain about uploading the file directly into Sitecore media library programmatically. below is the list of steps will be following to Upload the file to Sitecore

  • Coding cshtml & Ajax API calls
  • Coding to Create the Month & Year Wise Folders to store the uploading images
  • code to publish the created folders.

Code cshtml & Ajax API calls

Create a cshtml and add the following list of Code

<input type=”file” id=”FileUpload1″ />
<input type=”button” id=”btnUpload” value=”Upload Files” />

and then create a separate javascript file and add the following ajax API call functionality, it will help to pass the attached file to the form and it can also send the other input data

$(document).ready(function () {
$(‘#btnUpload’).click(function () {

// Checking whether FormData is available in browser
if (window.FormData !== undefined) {

var fileUpload = $(“#FileUpload1”).get(0);
var files = fileUpload.files;

// Create FormData object
var fileData = new FormData();

// Looping over all files and add it to FormData object
for (var i = 0; i < files.length; i++) {
fileData.append(files[i].name, files[i]);
}

// Adding one more key to FormData object
fileData.append(‘username’, ‘Manas’);

$.ajax({
url: ‘/Home/UploadImage’,
type: “POST”,
contentType: false, // Not to set any content header
processData: false, // Not to process data
data: fileData,
success: function (result) {
alert(result);
},
error: function (err) {
alert(err.statusText);
}
});
} else {
alert(“FormData is not supported.”);
}
});
});

Create the Action Result and add the below code to Upload an Image,

1

Code to create Sitecore Folder programmatically

2.1

Code to attach the File to Sitecore Media Library

2

3

Code to Publish the newly Inserted media items 

4

Final View of the uploaded Images 

5

Bundling with Sitecore 6.5 to 8.2 + versions of Sitecore

Asp.net MVC4 bundling and minification it helps to avoid the repeated request to Servers and enables caching the data into server Memory.

I have got a chance to implement bundling in two Sitecore Versions

  • Sitecore 6.5 (Web Forms)
  • Sitecore 8.1 (MVC)

Let’s See how to implement bundling in Sitecore 6.5

Bundling in Sitecore 6.5 to  8.1 version

1)Open NuGet packet manager and execute the below command

2)Create a Class and add the .css file and .js file path as like below

3)Open Global.asax.cs file and open Application Start Event and add your bundling class

4)add the Script bundle and style bundle into the IgnoreUrlPrefixes as like below

5) Now remove the actual reference of your css &js files inside the code and add the below code to refer the files

Below is the reference in case of Web forms

 Bundling in Sitecore 8.2 and greater version

Sitecore removed the functionality of Global.asax.cs Application_Start event from Sitecore 8.2 onwards because its Inheriting Sitecore.Web.Application.  So we need to use the sitecore pipeline approach as per the blog post as below.

I already implemented asp.net bundling using Sitecore Pipeline as per the below blog post , its working absolutely fine

http://jockstothecore.com/bundling-with-sitecore-mvc/