Showing posts with label Ektron CMS. Show all posts
Showing posts with label Ektron CMS. Show all posts

Thursday, April 26, 2012

Get the List of calendar events in ektron cms

The ektron calendar provides an easy ways to site admin to add,edit and update the events for calendar year or more.Here i will show how to get the calendar events list to list view.Using Web calendar API ,i will send the calendar id ,start date and end date as input parameters to get the list items between data range.Here the method Getlist() which will give the list of calendar events
 Ektron.Cms.Controls.Calendar c = new Ektron.Cms.Controls.Calendar();
 WebEventManager wManager = new WebEventManager();
 //calendar id in Workarea
 long calId = 1654;
 String st = DateTime.Now.ToString();//cuurent date
 String et = "31-04-2012 17:30:00";
 DateTime startdate= DateTime.Parse(st);
 DateTime enddate = DateTime.Parse(et);
 List webeventcalendarList = wManager.GetList(calId,startdate,enddate);
 if (webeventcalendarList != null)
{
list_events.DataSource = webeventcalendarList;
list_events.DataBind();
}
 else
{
Response.Write("There is no list of events");
}

Wednesday, March 21, 2012

How to create RSS in ektron CMS

Here i will show how to create a RSS for collection data in Ektron cms.In ektron cms we have an option ecmRssCollection method to get the data to rss feed object.There one more server control i:e RSSagrregator is also used to ge the rss feed data.I have collection control in my results page.When ever click on the Rss feed the query string value is passed to the rss page .The rss page shouldn't have HTML content.By default the aspx page has HTML content so we have to remove the content in this page.If we don't remove the html content in page we not get the rss data in Chrome browser.The 15 is the collection default ID in work area

if (Request.QueryString["rss"] == "collectionDatatest")
{
object rssFeedData = null;
Ektron.Cms.UI.CommonUI.ApplicationAPI AppCUI = new Ektron.Cms.UI.CommonUI.ApplicationAPI();
rssFeedData = AppCUI.ecmRssCollection(15)
Response.ContentType = "text/xml";
Response.Write(rssFeedData);
}

Tuesday, March 20, 2012

How to send a mail in ektron cms

In Ektron CMS we have a reference to send a mail i;e EkMailRef.This service has taken the server name from the web.config file.In web.config file the ek_key values are available to give the server name ,from and to user name.The below code will use to send a mail in ektron cms

CommonApi commonApi = new CommonApi();
EkMailService MailService = commonApi.EkMailRef;
MailService .MailFrom = "bhaskar7698@gmail.com;
MailService .MailTo = bhaskar7698@gmail.com;
MailService .MailSubject = "Test";
MailService .MailBodyText = "send mail in ektron cms;
MailService .SendMail();

Friday, March 2, 2012

How to Get the MetaData of ContentBlock in Ektro CMS

Here i will show how to get the meta data of content in ektron CMS.We have some API features to get the meta data of content block.In this One is Content API and other one is meta data API.The another way i:e Taxonomy is used to get the content block details.But it to difficult comparing with existing API.Here the content id is getting from Page host then pass to content Id variable.Then get the meta data of content using following code

codebehind:

Ektron.Cms.Controls.ContentBlock cb = new Ektron.Cms.Controls.ContentBlock();
cb.DefaultContentID = contentid;
Ektron.Cms.API.Content.Content CAPi = new Ektron.Cms.API.Content.Content();
Ektron.Cms.ContentData CData = new Ektron.Cms.ContentData();
CData = CAPi.GetContent(contentid, Ektron.Cms.
ContentAPI.ContentResultType.Published);
Label lbf = new Label();
lbf.Text = "

"+CData.Title.ToString()+"

"; string image=CData.Image.ToString();
// using meta data API
Ektron.Cms.API.Metadata mapi = new Ektron.Cms.API.Metadata();
Ektron.Cms.CustomAttributeList cList = new Ektron.Cms.CustomAttributeList();
cList = mapi.GetContentMetadataList(contentid); 
//Content ID
Response.Write(cList.AttributeList.Length.ToString());
Response.Write(cList.GetItemByName("Image"));

Monday, February 6, 2012

how to create breadcrumb in Ektron cms

Breadcrumbs are display at top of a web page ,which is provide the path for where we came from previously.breadcrumbs are set at the folder level, so we have to give them only for the main content block in the folder, Then breadcrumbs will automatically be set for the remaining of that folder’s content.
Ektron.Cms.API.Content.Content contentApi = new Ektron.Cms.API.Content.Content();
ContentData content = contentApi.GetContent(PageHost1.PageID);

if (content != null)
{
this.Master.ShowMetaTitle(content.Title);
long fid=content.FolderId;
Ektron.Cms.API.Folder folderApi = new Ektron.Cms.API.Folder();
FolderData folder = folderApi.GetFolder(fid);
if (folder == null)
return;
Ektron.Cms.Common.SitemapPath[] mapPath = folder.SitemapPath;
if (mapPath == null)
return;
StringBuilder sb = new StringBuilder();
for (int i = 0; i < mapPath.Length; i++)
{
if (mapPath[i] == null)
continue;
if (sb.Length != 0)
sb.Append(" > ");
if (i < mapPath.Length - 1)
sb.AppendFormat("{1}",!String.IsNullOrEmpty(mapPath[i].Url) ? "/" + mapPath[i].Url : "/", mapPath[i].Title);
else
sb.Append(mapPath[i].Title);
}
BreadCrumb.Text = sb.ToString();
} 

Thursday, February 2, 2012

Programmatically get the taxonomy in ektron cms

Taxonomy is used to specify the hierarchical path in website.When ever we create a taxonomy for website we need to follow the menu structure in work area.Here i will show how to create a Bread crumb using Taxonomy.Before get the bread crumb path we have to know about condition which are get the child and parent items in taxonomy,Which API code have to use to get the data of Taxonomy.The Taxonomy API is used to get the taxonomy API.Here i have taken a bread crumb server control and assigned the path of pages.
Default.aspx:
The page is getting by using the Page Host when the page is loaded,then the content id is get by using page Id.When ever page load The taxonomy data does get all the categories. For this we need to loop through it to get the all.The parentId > 0 is t get the parent item s of current page in taxonomy
Code behind:
using System;
using Ektron.Cms;
using System.Xml;
using System.Text;
using System.Collections.Generic;
using Ektron.Cms.Common;
using Ektron.Cms;
using System.Web.UI.WebControls;
public partial class SubPageLevel_1 : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
Ektron.Cms.API.Content.Content contentApi = new Ektron.Cms.API.Content.Content();
ContentData content = contentApi.GetContent(PageHost1.PageID);
if (content != null)
{           
this.Master.ShowMetaTitle(content.Title);
long cid = content.Id;
if (cid > 0)
{
Ektron.Cms.API.Content.Taxonomy TaxAPI = new Ektron.Cms.API.Content.Taxonomy();
Ektron.Cms.TaxonomyBaseData[] TaxData = TaxAPI.ReadAllAssignedCategory(cid);
foreach (Ektron.Cms.TaxonomyBaseData t in TaxData)
{
if (!Page.IsPostBack)
{
long taxid = t.TaxonomyId;
Ektron.Cms.Controls.Directory taxControl = new Ektron.Cms.Controls.Directory();
taxControl.TaxonomyId = taxid;
taxControl.Page = this.Page;
taxControl.Fill();
Ektron.Cms.TaxonomyData taxData = new Ektron.Cms.TaxonomyData();
taxData = taxControl.TaxonomyTreeData;
long parentId = taxData.TaxonomyParentId;
TaxonomyData tmpTaxData = default(TaxonomyData);
Ektron.Cms.Controls.Directory tmpTaxControl = default(Ektron.Cms.Controls.Directory);
string breadCrumb = taxData.TaxonomyName;
string link = null;
while (parentId > 0)
{
tmpTaxData = new TaxonomyData();
tmpTaxControl = new Ektron.Cms.Controls.Directory();
tmpTaxControl.TaxonomyId = parentId;
tmpTaxControl.Page = this.Page;
tmpTaxControl.Fill();
tmpTaxData = tmpTaxControl.TaxonomyTreeData;
link = "" + Server.HtmlDecode(tmpTaxData.TaxonomyName) + " > ";
breadCrumb = breadCrumb.Insert(0, link);
parentId = tmpTaxData.TaxonomyParentId;
tmpTaxControl = null;
}
taxoBreadCrumb.Text = breadCrumb;
}
}
}
}
}
}

Tuesday, December 20, 2011

How to create smart form in Ektron CMS

might be think all why we using smart form? The same thought i had when working with smart form in ektron cms.In Ektron the Smart Forms used to separating Web content from presentation and avoid the duplicate content from users.The smart form can deliver the content to multiple devices and easy to share .There is two ways to create smart form in Ektron
1. WYSIWYG Data Designer
2. Xml files
Here i will shown how to create a smart form in work area and assign to particular folder in it.The fallowing steps will be needed to create smart form
Go to Work Area-->Settings-->Smart Form Configuration
There is a plus symbol at top most left to add the smart form to smart form configuration.After make a selection we will get a text box to give a name to smart form.Here i have given a name as "smart form1" .After add the name of the smart form we have to save this.For this there is option at left top most.
We will get XML configuration form to create an desirable deign.Here i have taken two check boxes in the form then updated.The below screen shot will shown how it was.u can edit the page if you are familiar with XML.For this we have an option at bottom of screen to
If we want see the smart form individually you should do the following steps.
settings-->smart form Configuration
whenever click on the configuration manager you can the total smart forms are available in work area.Then click on one of smart form you can see the properties of this.Here we can edit using edit button at top of the work area
How to assign the Smart form to Folder:
In work are each folder having the property smart form to attach desirable smart form.Here you can see the properties of folders in work area.For this i have taken personal folder in work area.
To give the desirable smart form to folder you have to unchecked the option inherit parent configuration then the drop down is enabled to select the smart forms
After add the smart form to particular folder you can see it in new tab option.the fallowing screen shot will describes where will it has added.
This smart form content is useful for many of content blocks in work area.

Wednesday, November 23, 2011

Add Server control using Drag and Drop in Ektron

Here i will shown how to  add some server controls to Template page.For doing this the fallowing steps to be need to do this.
1.We should add the Ektron.Control dll to get the server controls in to tool box
2.Go to visual studio Tool box(View-->Tools)
3.Click on Ektron Server controls.Then the server controls are appeared like as below
4.To add the Ektron server controls to desirable place  using Drag and drop

Monday, November 21, 2011

Latest version and features of Ektron CMS

Ektron CMS .net 8.5 is the latest version which has been released by September 29 2011
In this version the work area is more optimized so the users to be more productive.It is the first enterprise .NET web content management to deliver a 3-tier architecture.

New Features in this version:

             1.Expanded developer API
             2.3-tier architecture
             3..NET 4.0 support
             4.Enhanced search capabilities
             5.e Sync enhancements
             6.Microsoft Fast search which is supported for  all types of web content like Microsoft office and multimedia
            
Content target:

The Content Targeting PageBuilder widget is available to  users to target content based on user form submission data.

 

Thursday, November 17, 2011

Create a Page layout(aspx page) in ektron CMS

In this article i will shown how to create Page lay out in ektron cms .For doing this  we have to login into cms work area.Then select the Content tab which is at top of the work area page.
 Then Select the page layout option in new tab in content area.Whenever click on that option we will get a pop up  to select the master page lay out for this page .Here  we can change the folder path which one we will want to add to  this  page lay out


There is a button to go for the next step .When ever click on the next button we will get one more pop which is contains the options to give a name of the page ,taxonomy and meta data.The page will be created when we complete these steps

Tuesday, November 15, 2011

Create a widget in Ektron Cms

Before going to Create a widget we have a basic knowledge on web user controls in asp.net .Because the web user controls are used to create a widget in ektron Cms .The widget has its own properties which are created by user and get the information of ektron controls from Ektron Api.For this we will create an user control in web application .This use control has to add to the work area .The fallowing steps to be needs to add the control workarea.In this work area we have tab options which are content,library,settings ,reports.To add the user control we should go to
1. settings -->Personalisation-->widgets

Here we have a synchronization to add the user controls to work area .After adding the user control we can add the widgets to desirable pages by using template page configuration

Show the page host and drop zone on page in ektron CMS

The pagehost has widgets which are placed on webpages.These widgets are user control which is developed using asp .net web application.These user controls are added to ektron work area in widget synchronization folder .Here we have an option to add the widgets to pages in work area.Then we can see the drop zone which is used place the widgets on pages.The given image is the dropzone on the page

This the drop zone area on page to place the widgets .Here i placed a collection widget.To select the collections here we have an edit button on top most of the drop zone .By this way we can place the widgets on page on ektron CMS

Create a collection widget in EKtron cms

Collection is list of links to the user on a webpage.It is used to display content links like Latest news and releases.Here i will explain how to create a collection  widget In ektron Cms. There is an option to create a collection  in work area under desirable path.The default id is generated for any element which are  created in work area .Each  collection can manage number of content blocks which  is having the information what we are provided to that.The collection server control having the DefaultDisplaystyle property for display the collection in different appearance using XSLT .The following name spaces have to add to  web application for  creating a collection widget using ektron work area
Add the Collection.ascx to Work Area(Widgets):

Now the  collection user control will be added to widget folder which is under Personalization folder in work area.The below screen shots will give the idea to add the this control to work area
It has the path of personalization folder in work area and synchronization option for user controls which are created in widget folder in application



 It has the widget folder path under personalization
After selecting this folder we have a option synchronization which has shown in above figure -1 to add the user controls which are created in widget  folder in application.Here we have an edit option for every control in work area which can be using to change the title and label name etc.
Namespaces which are added to application to develop the collection widget:
Ektron.Cms.Widget;
Ektron.Cms;
Ektron.Cms.API;
Ektron.Cms.Common;
Ektron.Cms.Controls.CmsWebService;
Ektron.Cms.PageBuilder;
Get the id of collection:
Ektron.Cms.Controls.Collection Collection1 = new Ektron.Cms.Controls.Collection();
Collection1.Page = Page;
Collection1.DefaultCollectionID = CollectionId;
By this way we will allocate the remaining values of collection dynamically.then we will generate events for edit ,cancel the collection wiget.

Bel