This was all about Scenario's which I involved in my profession.
Saturday, 6 April 2019
Friday, 22 March 2019
Create new table row for every 4th loop
<table>
@for (int i = 0; i < ViewBag.MyItems.Count; i++)
{
var cells = 4;
var item = ViewBag.MyItems[i];
if ((i % cells) == 0)
{
@:<tr>
}
<td>
@item.MyTextOrWhatever
</td>
if (i == (ViewBag.MyItems.Count - 1))
{
while ((i % cells) != 0)
{
@:<td></td>
i++;
}
}
if ((i % cells) == (cells - 1)) // aka: last row cell
{
@:</tr>
}
}
</table>
Thursday, 7 March 2019
Thursday, 13 December 2018
Export and Import Application Pools, Sites, Applications on IIS
To Export the Application Pools on IIS:
%windir%\system32\inetsrv\appcmd list apppool /config /xml > c:\apppools.xml
To import the Application Pools:
%windir%\system32\inetsrv\appcmd add apppool /in < c:\apppools.xml
To Export all you’re website:
%windir%\system32\inetsrv\appcmd list site /config /xml > c:\sites.xml
To Import the website:
%windir%\system32\inetsrv\appcmd add site /in < c:\sites.xml
To Export all you’re application:
%windir%\system32\inetsrv\appcmd list app /config /xml > c:\app.xml
To Import the application:
%windir%\system32\inetsrv\appcmd add app /in < c:\app.xml
To export/import a single application pool:
%windir%\system32\inetsrv\appcmd list apppool “MyAppPool” /config /xml > c:\myapppool.xml
Friday, 9 November 2018
Add new feature for habitat project solution - Creating a new Feature Module
In this exercise we will create a new feature module in our solution.
Modules are a conceptual grouping of all assets related to a single business requirement. When working in a Helix solution, you will create modules to contain all of these assets by following the steps we walk through in this exercise, leveraging Visual Studio and File Explorer.
Creating a new Feature Module
The following steps are required for creating the Events module in Visual studio:
- Open Windows File Explorer and navigate to c:/projects/sitecore.demo.group
- Create the following folder structure: /src/Feature/Events
- Open Visual Studio 2017
- Open the Habitat Group website solution from c:/projects/sitecore.demo.group
- Create a Solution folder in the root named “Feature”
- Create a Solution folder in “Feature” named “Events”
- Create a new Visual Studio Project in the “Events” folder:
- Use the “ASP.NET Web Application” template
- Location should be “C:\Projects\Sitecore.Demo.Group\src\Feature\Events”
- Name should be “code” as this will create the correct folder structure. We'll rename the project in the next step.
- On the next screen, choose the “Empty” template and check the “MVC folders” checkbox
- Set the properties for the new project
- Rename the project to “Sitecore.Feature.Events”
- In the project properties set the assembly name and namespace to “Sitecore.Feature.Events”
- Update the project to .NET Framework 4.6.2
- Delete the App_Data, App_Start and Global.asax files and folders
- Ensure the web.config is not published with the project
- Open properties for the web.config and /views/web.config files
- Set “Build Action” to “None”
- Add configuration files
- Under App_Config/Include, create a folder named “Feature”.
- Add Sitecore Kernel NuGet reference
- Right-click the project and select "Manage NuGet Packages"
- Change package source to the Sitecore NuGet feed
- Click Browse
- Find and install Sitecore.Kernel.NoReferences, and select version 9.0.180604
- Find and install Sitecore.Mvc.NoReferences, and select version 9.0.180604
- Set publish options
- Copy the “/Properties/PublishProfiles” folder from the Project/Sitecore.Demo.Group project into the same place in the Sitecore.Feature.Events project
- Publish the project (note -- we're using Gulp in this workshop to do publishing and deployment, not Web Deploy)
- Save the Visual Studio solution
- In the Task Runner window, run “Publish all Projects”. If Task Runner Explorer isn't visible in your workspace, you can add it by selecting View -> Other Windows -> Task Runner Explorer in Visual Studio.
Thursday, 1 November 2018
Subscribe to:
Posts (Atom)
Extracting Nupkg files using command line
Rename it to zip first then extract files as below 1. Rename-Item -Path A_Package.nupkg -NewName A_Package.zip 2. Make sure to repla...