Go Back

Sitefinity API Tips & Tricks Webinar

Under the hood Sitefinity has a very rich API that can be used to interact with CMS resources.  This webinar will demonstrate how to use this API to create, update and retrieve CMS resources.  In addition, we'll explore how to use this API to create advanced features and wield CMS resources in unexpected ways.

The original video can be watched on telerik.tv.

The notes for this webinar can be found here.

This webinar covers the following topics:

  • Sitefinity Pages API Overview
  • Fetch all pages
  • Fetch some page
  • Create a new page
  • Find a page by name
  • Deleting pages
  • Create a page - set properties, set templates, set themes and add controls
  • Modify a page – alter existing controls, add additional controls
  • Rollback to a previous version of the page
  • Generic Content API Overview
  • Get Generic Content items
  • Setting a new Generic Content Provider
  • Getting news using the ContentManager
  • Getting news using the NewsManager
  • Add an Event – set category and tags using ContentManager
  • Add an Event – set category and tags using EventsManager
  • Finding events by title
  • Finding events by date
  • Finding events by tag – GetContent, GetEvents
  • Modifying an Event
  • Rollback to a previous version of an event
  • Non-Generic Content Based Modules – API Overview
  • Add a new List item

Comments  7

  • Lino 20 Aug

    Dude! You are just Awesome!
  • Peter 24 Aug

    I have used this excellent webinar as inspiration to build a conversion program. I can now import from our old CMS system and it saves me much time. The only thing I could not find is how to save a page directly into a folder such as "About Us". Can anyone help?

  • Peter 25 Aug

    I have used this excellent webinar as inspiration to build a conversion program. I can now import from our old CMS system and it saves me much time. The only thing I could not find is how to save a page directly into a folder such as "About Us". Can anyone help?

  • Lino 25 Aug

    Hi Peter,

    Are you physically trying to save the page (aspx file) to a folder that you created in the structure of the site?  Because Sitefinity will allow you to do that but this is not the way Sitefinity really works.  The Sitemap of the site with all the page group are virtual and available in the database NOT on disk.  In any case, if you have to save the file to disk for whatever reason, you can use FileIO API or IIS API to do so, make sure you have permissions on the machine to do so.
    Otherwise, simply creating the new page and telling it which page group is its parent is more than enough for Sitefinity to do the rest in the database.

    Hoep that helps
    Cheers
    Lino
  • Peter 26 Aug

    Hi Lino, Thanks for your reply. 
    I am fully aware of the virtual directories that are created in the sitemap.

    Gabe has a section ("Create a Sitefinity Page with Content") where he shows how to save a new page in the root.

    When I import from another CMS-system with MS SQL DB to Sitefinity I want not only to import to root dir.

    I must import hundreds of pages and it would obviously be helpful if the pages could be imported into their virtual folders, as for example "About us".

    I would think that this line is the area of code that contains the solution:
    "ICmsPage page = manager.CreatePage("TestPage");"
    I've tried various combinations such as this line: "ICmsPage page = manager.CreatePage("About-us/TestPage");" without any luck.

    Best regards

    Peter

  • Lino 31 Aug

    Hi Peter,

    The CreatePage method is an overloaded function that can take different parameters.
    In your case you need to find what the ID (GUID) of the parent page and then when you create the new page you can call it like the following:
    ICmsPage mypage = manager.CreatePage("NewPage", parentpage.ID);

    Hope this helps 
    Cheers 
    -Lino

  • peter 31 Aug

    Hi Lino
    Many thanks for your help. It will save me much time!

    Best regards
    Peter
Post a comment!
  1. Formatting options
       
     
     
     
     
       
  2. I'm sorry for the CAPTCHA. You have spammers to thank for this: