Surendra Sharma

Surendra Sharma

Search This Blog

Friday, December 2, 2016

LexBlog To Sitecore - Part 1 - LexBlog Basics



Sitecore again proved itself as a no. 1 CMS platform as per Gartner ratings and hence more and more customers are attracting towards Sitecore. 

Some customers already have their business and organizations websites however some customers are looking to launch new web solution for their business. For both type of customers Sitecore provides an excellent opportunities to grow their business in a digital world.

So more customers means more business which is good for Sitecore, good for companies who are working on Sitecore and so great for Sitecore developers communities. So it’s a win-win situation for all of us.

If solution providers can migrate and help in relaunching of customers existing websites in a short period of time then it will be great for the organization who already running website and looking to redeveloped their website in Sitecore.

This article is about moving WordPress based LexBlog solution to Sitecore. By using below technic anyone can move LexBlog articles to Sitecore within a hour.     

What is LexBlog?

LexBlog is a platform for providing blog for legal professional, firms etc.

LexBlog is built on top of the WordPress.



LexBlog XML Format


You can take backup of LexBlog site into XML file. Below is a sample XML file for the same.

<?xml version="1.0" encoding="UTF-8" ?>
<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. -->
<!-- It contains information about your site's posts, pages, comments, categories, and other content. -->
<!-- You may use this file to transfer that content from one site to another. -->
<!-- This file is not intended to serve as a complete backup of your site. -->

<!-- To import this information into a WordPress site follow these steps: -->
<!-- 1. Log in to that site as an administrator. -->
<!-- 2. Go to Tools: Import in the WordPress admin panel. -->
<!-- 3. Install the "WordPress" importer from the list. -->
<!-- 4. Activate & Run Importer. -->
<!-- 5. Upload this file using the form provided on that page. -->
<!-- 6. You will first be asked to map the authors in this export file to users -->
<!--    on the site. For each author, you may choose to map to an -->
<!--    existing user on the site or to create a new user. -->
<!-- 7. WordPress will then import each of the posts, pages, comments, categories, etc. -->
<!--    contained in this file into your site. -->

<!-- generator="WordPress/4.3.2" created="2016-08-16 18:56" -->
<rss version="2.0"
       xmlns:excerpt="http://wordpress.org/export/1.2/excerpt/"
       xmlns:content="http://purl.org/rss/1.0/modules/content/"
       xmlns:wfw="http://wellformedweb.org/CommentAPI/"
       xmlns:dc="http://purl.org/dc/elements/1.1/"
       xmlns:wp="http://wordpress.org/export/1.2/"
> 

  <channel>
    <title>My Sample Blog</title>
    <link>http://www.sampleblog.com</link>
    <description></description>
    <pubDate>Tue, 16 Nov 2016 18:56:42 +0000</pubDate>
    <language>en-US</language>
    <wp:wxr_version>1.2</wp:wxr_version>
    <wp:base_site_url>http://engage.lexblog.com/</wp:base_site_url>
    <wp:base_blog_url>http://www.sampleblog.com</wp:base_blog_url>

    <wp:author>
      <wp:author_id>1</wp:author_id>
      <wp:author_login>admin</wp:author_login>
      <wp:author_email>development@lexblog.com</wp:author_email>
      <wp:author_display_name><![CDATA[LexBlog Admin]]></wp:author_display_name>
      <wp:author_first_name><![CDATA[LexBlog]]></wp:author_first_name>
      <wp:author_last_name><![CDATA[Admin]]></wp:author_last_name>
    </wp:author>
    <wp:author>
      <wp:author_id>1011</wp:author_id>
      <wp:author_login>stevejob</wp:author_login>
      <wp:author_email>steve@sampleblog.com</wp:author_email>
      <wp:author_display_name><![CDATA[Steve Job]]></wp:author_display_name>
      <wp:author_first_name><![CDATA[Steve]]></wp:author_first_name>
      <wp:author_last_name><![CDATA[Job]]></wp:author_last_name>
    </wp:author>
    <wp:author>
      <wp:author_id>1774</wp:author_id>
      <wp:author_login>author1</wp:author_login>
      <wp:author_email>Manoj.Gupta@sampleblog.com</wp:author_email>
      <wp:author_display_name><![CDATA[Manoj B. Gupta]]></wp:author_display_name>
      <wp:author_first_name><![CDATA[Manoj]]></wp:author_first_name>
      <wp:author_last_name><![CDATA[Gupta]]></wp:author_last_name>
    </wp:author>
    <wp:author>
      <wp:author_id>1775</wp:author_id>
      <wp:author_login>author2</wp:author_login>
      <wp:author_email>Rakesh.Varma@sampleblog.com</wp:author_email>
      <wp:author_display_name><![CDATA[Rakesh Varma]]></wp:author_display_name>
      <wp:author_first_name><![CDATA[Rakesh]]></wp:author_first_name>
      <wp:author_last_name><![CDATA[Varma]]></wp:author_last_name>
    </wp:author>
    <wp:author>
      <wp:author_id>1776</wp:author_id>
      <wp:author_login>author3</wp:author_login>
      <wp:author_email>Satish.Goyal@sampleblog.com</wp:author_email>
      <wp:author_display_name><![CDATA[Satish F. Goyal]]></wp:author_display_name>
      <wp:author_first_name><![CDATA[Satish]]></wp:author_first_name>
      <wp:author_last_name><![CDATA[Goyal]]></wp:author_last_name>
    </wp:author>

    <wp:category>
      <wp:term_id>45</wp:term_id>
      <wp:category_nicename>category1</wp:category_nicename>
      <wp:category_parent></wp:category_parent>
      <wp:cat_name><![CDATA[Category 1]]></wp:cat_name>
    </wp:category>
    <wp:category>
      <wp:term_id>46</wp:term_id>
      <wp:category_nicename>category2</wp:category_nicename>
      <wp:category_parent></wp:category_parent>
      <wp:cat_name><![CDATA[Category 2]]></wp:cat_name>
    </wp:category>
    <wp:category>
      <wp:term_id>47</wp:term_id>
      <wp:category_nicename>category3</wp:category_nicename>
      <wp:category_parent></wp:category_parent>
      <wp:cat_name><![CDATA[Category 3]]></wp:cat_name>
    </wp:category>

    <wp:tag>
      <wp:term_id>41</wp:term_id>
      <wp:tag_slug>tag-1</wp:tag_slug>
      <wp:tag_name><![CDATA[Tag 1]]></wp:tag_name>
    </wp:tag>
    <wp:tag>
      <wp:term_id>42</wp:term_id>
      <wp:tag_slug>tag-2</wp:tag_slug>
      <wp:tag_name><![CDATA[Tag 2]]></wp:tag_name>
    </wp:tag>
    <wp:tag>
      <wp:term_id>43</wp:term_id>
      <wp:tag_slug>tag-3</wp:tag_slug>
      <wp:tag_name><![CDATA[Tag 3]]></wp:tag_name>
    </wp:tag>

    <wp:term>
      <wp:term_id>52</wp:term_id>
      <wp:term_taxonomy>author</wp:term_taxonomy>
      <wp:term_slug>author1</wp:term_slug>
      <wp:term_parent></wp:term_parent>
      <wp:term_name><![CDATA[author 1]]></wp:term_name>
    </wp:term>
    <wp:term>
      <wp:term_id>51</wp:term_id>
      <wp:term_taxonomy>author</wp:term_taxonomy>
      <wp:term_slug>author2</wp:term_slug>
      <wp:term_parent></wp:term_parent>
      <wp:term_name><![CDATA[author 2]]></wp:term_name>
    </wp:term>
    <wp:term>
      <wp:term_id>79</wp:term_id>
      <wp:term_taxonomy>author</wp:term_taxonomy>
      <wp:term_slug>author3</wp:term_slug>
      <wp:term_parent></wp:term_parent>
      <wp:term_name><![CDATA[author 3]]></wp:term_name>
    </wp:term>


    <generator>http://wordpress.org/?v=4.3.2</generator>


    <item>
      <title>Article 1</title>
      <link>http://www.sampleblog.com/2015/07/09/article-1/</link>
      <pubDate>Wed, 09 Jul 2015 14:27:13 +0000</pubDate>
      <dc:creator><![CDATA[mvodicka]]></dc:creator>
      <guid isPermaLink="false">http://www.sampleblog.com/?p=389</guid>
      <description></description>
      <content:encoded>
        <![CDATA[In a<a href="http://www.xyz.gov/#!documentDetail;D=CDA-2016-P-2000-0001"> animal petition</a>,

This is article 1 and contain:
<ul><li>list item 1;</li></ul><ul> <li>List item 2</li></ul><ul>     <li>List item 3.</li></ul>
Check for more updates.]]>
      </content:encoded>
      <excerpt:encoded><![CDATA[]]></excerpt:encoded>
      <wp:post_id>389</wp:post_id>
      <wp:post_date>2015-07-09 10:27:13</wp:post_date>
      <wp:post_date_gmt>2015-07-09 14:27:13</wp:post_date_gmt>
      <wp:comment_status>closed</wp:comment_status>
      <wp:ping_status>closed</wp:ping_status>
      <wp:post_name>article-1</wp:post_name>
      <wp:status>publish</wp:status>
      <wp:post_parent>0</wp:post_parent>
      <wp:menu_order>0</wp:menu_order>
      <wp:post_type>post</wp:post_type>
      <wp:post_password></wp:post_password>
      <wp:is_sticky>0</wp:is_sticky>
      <category domain="author" nicename="author2"><![CDATA[Author 2]]></category>
      <category domain="post_tag" nicename="tag-1"><![CDATA[Tag 1]]></category>
      <category domain="category" nicename="category1"><![CDATA[Category 1]]></category>
      <category domain="post_tag" nicename="tag-2"><![CDATA[Tag 2]]></category>
      <category domain="post_tag" nicename="tag-3"><![CDATA[Tag 3]]></category>
      <wp:postmeta>
        <wp:meta_key>_edit_last</wp:meta_key>
        <wp:meta_value><![CDATA[1774]]></wp:meta_value>
      </wp:postmeta>
    </item>
    <item>
      <title>Article 2</title>
      <link>http://www.sampleblog.com/2015/07/10/article-2/</link>
      <pubDate>Wed, 10 Jul 2015 14:27:13 +0000</pubDate>
      <dc:creator><![CDATA[mvodicka]]></dc:creator>
      <guid isPermaLink="false">http://www.sampleblog.com/?p=390</guid>
      <description></description>
      <content:encoded>
        <![CDATA[In a<a href="http://www.xyz.gov/#!documentDetail;D=CDA-2016-P-2000-0001"> animal society</a>,

This is article 2 and contain:
<ul><li>list item a;</li></ul><ul> <li>List item b</li></ul><ul>     <li>List item c.</li></ul>
Check for more updates.]]>
      </content:encoded>
      <excerpt:encoded><![CDATA[]]></excerpt:encoded>
      <wp:post_id>390</wp:post_id>
      <wp:post_date>2015-07-10 10:27:13</wp:post_date>
      <wp:post_date_gmt>2015-07-10 14:27:13</wp:post_date_gmt>
      <wp:comment_status>closed</wp:comment_status>
      <wp:ping_status>closed</wp:ping_status>
      <wp:post_name>article-2</wp:post_name>
      <wp:status>publish</wp:status>
      <wp:post_parent>0</wp:post_parent>
      <wp:menu_order>0</wp:menu_order>
      <wp:post_type>post</wp:post_type>
      <wp:post_password></wp:post_password>
      <wp:is_sticky>0</wp:is_sticky>
      <category domain="author" nicename="author1"><![CDATA[author 1]]></category>
      <category domain="category" nicename="category2"><![CDATA[Category 2]]></category>
      <category domain="post_tag" nicename="tag-1"><![CDATA[Tag 2]]></category>
      <category domain="post_tag" nicename="tag-3"><![CDATA[Tag 3]]></category>
      <wp:postmeta>
        <wp:meta_key>_edit_last</wp:meta_key>
        <wp:meta_value><![CDATA[1774]]></wp:meta_value>
      </wp:postmeta>
    </item>
  </channel>
</rss>


Let’s analyze this XML file.

This XML file is in WordPress format.

This XML file is categories into various parts as
  • Basic Details
  • Authors
  • Categories
  • Tags
  • Terms
  • Blog articles as an items

Basic Details


The first part provide basic details about blog like title, link, description, publish date of this blog site, blog language version etc as 

    <title>My Sample Blog</title>
    <link>http://www.sampleblog.com</link>
    <description></description>
    <pubDate>Tue, 16 Nov 2016 18:56:42 +0000</pubDate>
    <language>en-US</language>
    <wp:wxr_version>1.2</wp:wxr_version>
    <wp:base_site_url>http://engage.lexblog.com/</wp:base_site_url>
    <wp:base_blog_url>http://www.sampleblog.com</wp:base_blog_url>

Authors


Next part provides authors details which include id, login name, email, display name, first and last name as
<wp:author>
  <wp:author_id>1774</wp:author_id>
  <wp:author_login>author1</wp:author_login>
  <wp:author_email>Manoj.Gupta@sampleblog.com</wp:author_email>
  <wp:author_display_name><![CDATA[Manoj B. Gupta]]></wp:author_display_name>
  <wp:author_first_name><![CDATA[Manoj]]></wp:author_first_name>
  <wp:author_last_name><![CDATA[Gupta]]></wp:author_last_name>
</wp:author>

Categories


After that categories section which include id, nick name and category name as
<wp:category>
  <wp:term_id>45</wp:term_id>
  <wp:category_nicename>category1</wp:category_nicename>
  <wp:category_parent></wp:category_parent>
  <wp:cat_name><![CDATA[Category 1]]></wp:cat_name>
</wp:category>

Tags


Next part is related which tags which include id, name and slug name as
<wp:tag>
  <wp:term_id>41</wp:term_id>
  <wp:tag_slug>tag-1</wp:tag_slug>
  <wp:tag_name><![CDATA[Tag 1]]></wp:tag_name>
</wp:tag>

Terms


Next section is related which terms which include id, taxonomy name, parent term, slug name and name as
<wp:term>
  <wp:term_id>52</wp:term_id>
  <wp:term_taxonomy>author</wp:term_taxonomy>
  <wp:term_slug>author1</wp:term_slug>
  <wp:term_parent></wp:term_parent>
  <wp:term_name><![CDATA[author 1]]></wp:term_name>
</wp:term>

Item


Following this our main section is presnt i.e. individual blog items which include details information about article details like title, link, publish date, permanent link, content, id, post date, post type, authors for this article, categories of this article, tags associated with article etc. 

<item>
  <title>Article 1</title>
  <link>http://www.sampleblog.com/2015/07/10/article-2/</link> 
  <pubDate>Wed, 09 Jul 2015 14:27:13 +0000</pubDate>
  <dc:creator><![CDATA[author2]]></dc:creator>
  <guid isPermaLink="false">http://www.sampleblog.com/?p=389</guid>
  <description></description>
  <content:encoded>
    <![CDATA[In a<a href="http://www.xyz.gov/#!documentDetail;D=CDA-2016-P-2000-0001"> animal petition</a>,

    This is article 1 and contain:
    <ul><li>list item 1;</li></ul><ul>   <li>List item 2</li></ul><ul>     <li>List item 3.</li></ul>
    Check for more updates.]]>
  </content:encoded>
  <excerpt:encoded><![CDATA[]]></excerpt:encoded>
  <wp:post_id>389</wp:post_id>
  <wp:post_date>2015-07-09 10:27:13</wp:post_date>
  <wp:post_date_gmt>2015-07-09 14:27:13</wp:post_date_gmt>
  <wp:comment_status>closed</wp:comment_status>
  <wp:ping_status>closed</wp:ping_status>
  <wp:post_name>article-1</wp:post_name>
  <wp:status>publish</wp:status>
  <wp:post_parent>0</wp:post_parent>
  <wp:menu_order>0</wp:menu_order>
  <wp:post_type>post</wp:post_type>
  <wp:post_password></wp:post_password>
  <wp:is_sticky>0</wp:is_sticky>
  <category domain="author" nicename="author2"><![CDATA[Author 2]]></category>
  <category domain="post_tag" nicename="tag-1"><![CDATA[Tag 1]]></category>
  <category domain="category" nicename="category1"><![CDATA[Category 1]]></category>
  <category domain="post_tag" nicename="tag-2"><![CDATA[Tag 2]]></category>
  <category domain="post_tag" nicename="tag-3"><![CDATA[Tag 3]]></category>
  <wp:postmeta>
    <wp:meta_key>_edit_last</wp:meta_key>
    <wp:meta_value><![CDATA[1774]]></wp:meta_value>
  </wp:postmeta>
</item>



That’s it for the part I. In next part I will walk through with our strategy for moving this LexBlog Site into SQL Server and Sitecore.

I hope you like this Sitecore lesson. Stay tuned for more Sitecore related articles.

Till that happy sitecoring :)

Please leave your comments or share this article if it’s useful for you. 

Thursday, November 17, 2016

How to add task page in Sitecore Control Panel



This article is about adding task link and option in Sitecore control panel.

Here are quick steps 


  •  Login to Sitecore Desktop mode.
  • Select CORE Database
  • Open Content Editor
  • Add a new task page “My Task Page” under item “/sitecore/content/Applications/Control Panel” which is inherited from “/sitecore/templates/Sitecore Client/Tasks/Task page”.
o    Task page has two fields
§  Header – Enter text of Task page section
§  Icon – Specify path of icon image

  •  You can add Task Link and Task Option under Task page.
  • Add a new task link “My Task Link” under item “/sitecore/content/Applications/Control Panel/My Task page” which is inherited from “/sitecore/templates/Sitecore Client/Tasks/Task link”.
o    Task Link has three fields
§  Click – Specify verb name
§  Header – Enter text of Task link section
§  Icon – Specify path of icon image

  • Add a new Task Option “My Task Option” under item “/sitecore/content/Applications/Control Panel/My Task page” which is inherited from “/sitecore/templates/Sitecore Client/Tasks/Task option”.
o    Task Link has four fields
§  Click – Specify verb name
§  Header – Enter text of Task link section
§  ID – Specified ID of this task option
§  URL – Specify link

 
I added 2 items under task page for testing as

task page
Task Page


and that’s it.

So after adding task link and task option, my Sitecore Control Panel looks as

control panel
Control Panel


As you can notice, there is vacant space in My Task Page region. So to remove this, I just move down “My Task Page” under “Reports” item in CORE database content tree.

By moving position of an item, my Sitecore Control Panel looks much better now as

updated control panel
Updated Control Panel


I hope you like this quick Sitecore lesson. Stay tuned for more Sitecore related articles.

Till that happy sitecoring :)

Please leave your comments or share this article if it’s useful for you.

Monday, November 14, 2016

How to add buttons in Sitecore Experience Platform



In one of my project requirement, I have to add buttons in Sitecore Experience Platform screen.

Here are quick steps 


  •  Login to Sitecore Desktop mode.
  • Select CORE Database
  • Open Content Editor
  • Add a new group “My LaunchPad Group” under item “/sitecore/client/Applications/Launchpad/PageSettings/Buttons” which is inherited from “/sitecore/client/Applications/Launchpad/PageSettings/Templates/LaunchPad-Group
  • Add required number of button items under "/sitecore/client/Applications/Launchpad/PageSettings/Buttons/My LaunchPad Group" which is inherited from "/sitecore/client/Applications/Launchpad/PageSettings/Templates/LaunchPad-Button"
·         There are 4 fields in each LanuchPad-Button item
o    Text – Text which is display under icon
o    Icon – Image for LuanchPad-Button
o    Link – Redirect link on the button and text
o    OpenNewTab – If checked, open the link in new browser tab

I added 3 buttons – external link, internal link and image as
 
Launchpad Items
Launchpad Items

Note :-
When you specify external link, put link value with “http://” like http://www.google.com
While for internal link, provide link value as item path like “/sitecore/content/Home”

That’s it.

So after adding these 3 buttons, my Sitecore Experience Platform looks as

sitecore experience platform
Buttons in Sitecore Experience Platform


I hope you like this quick Sitecore lesson. Stay tuned for more Sitecore related articles.

Till that happy sitecoring :)

Please leave your comments or share this article if it’s useful for you.