More in this section

Forums / Developing with Sitefinity / EXTEND PAGE PROPERTIES

EXTEND PAGE PROPERTIES

6 posts, 0 answered
  1. Dale Palmer
    Dale Palmer avatar
    20 posts
    Registered:
    12 May 2008
    06 Feb 2009
    Link to this post
    Hi All,

    I am trying to extend the page properties so I can attach a thumbnail for each page. I have a added a TextBox with ID 'Thumbnail' in the PagePropertiesEdit.ascx user control located in /Sitefinity/Admin/ControlTemplates/Pages

    I have added a new field called Thumbnail to the sf_CmsPageProps table.

    I have updated the sf_CmsPageProps_upd stored procedure to accept the extra field.

    GO 
    /****** Object:  StoredProcedure [dbo].[sf_CmsPageProps_upd]    Script Date: 02/06/2009 16:19:41 ******/ 
    SET ANSI_NULLS ON 
    GO 
    SET QUOTED_IDENTIFIER ON 
    GO 
    ALTER PROCEDURE [dbo].[sf_CmsPageProps_upd] (@P_MenuName nvarchar(max), @P_Title nvarchar(max), @P_Description nvarchar(max), @P_Keywords nvarchar(max), @P_Navigable int, @P_DenyAnonymous bit, @P_RequireSSL bit, @P_RequireCaching bit, @P_DenyIndexing bit, @P_PageType int, @P_DefaultUrlIndex smallint, @P_ExternalUrl nvarchar(256), @P_InheritPermissions bit, @P_Owner nvarchar(50), @PO_Application nvarchar(50), @PO_ID uniqueidentifier, @P_Name nvarchar(50), @P_LoweredName nvarchar(50), @P_Ordinal int, @P_ParentID uniqueidentifier, @P_Thumbnail varchar(200)
    AS BEGIN 
        UPDATE [dbo].[sf_CmsPageProps] SET [MenuName] = @P_MenuName, [Title] = @P_Title, [Description] = @P_Description, [Keywords] = @P_Keywords, [Navigable] = @P_Navigable, [DenyAnonymous] = @P_DenyAnonymous, [RequireSSL] = @P_RequireSSL, [RequireCaching] = @P_RequireCaching, [DenyIndexing] = @P_DenyIndexing, [PageType] = @P_PageType, [DefaultUrlIndex] = @P_DefaultUrlIndex, [ExternalUrl] = @P_ExternalUrl, [InheritPermissions] = @P_InheritPermissions, [Owner] = @P_Owner, Thumbnail = @P_Thumbnail WHERE [Application] = @PO_Application AND [ID] = @PO_ID; 
            if @@rowcount <> 1 raiserror('Update conflict', 16, 1); 
        UPDATE [dbo].[sf_PageBase] SET [Name] = @P_Name, [LoweredName] = @P_LoweredName, [Ordinal] = @P_Ordinal, [ParentID] = @P_ParentID WHERE [Application] = @PO_Application AND [ID] = @PO_ID; 
            if @@rowcount <> 1 raiserror('Update conflict', 16, 1); 
     
    END
         

    But i get:

    Procedure or function 'sf_CmsPageProps_upd' expects parameter '@P_Thumbnail', which was not supplied.

    So basically the question is how do i link up my new text box to the @P_Thumbnail parameter?

    Regards
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    06 Feb 2009
    Link to this post
    Hello Dale Palmer,

    Thank you for using our services.

    We do not support additional properties for pages. This functionality will be available after Sitefinity 4.0, which will be released this year. Then, we will change the architecture and users will be able to customize pages as they do with modules.

    Let us know if there is anything else that we can do for you.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Dale Palmer
    Dale Palmer avatar
    20 posts
    Registered:
    12 May 2008
    06 Feb 2009
    Link to this post
    Hi Iva,

    Thanks for your quick reply. We had a urgent request from a client who wanted this implementing today.

    Is there any quick way around it?

    For example, When i click on a page, then click the properties tab, is there a way a can get the unique id for the page I am editing?

    I submitted a support ticket for this and was told to try the examples in http://www.sitefinity.com/help/developer-manual/pages-get.html but NON of these work. I always get a Object reference not set to an instance of an object.

        Public Sub btnSaveThumbnail_OnClick(ByVal sender As ObjectByVal e As System.EventArgs)  
            'If txtThumbnail.Text.Length > 0 Then  
            'Telerik.DataAccess.Configuration.ConfigHelper.Handler.  
            ' create a new instance of CmsManager  
            Dim cmsManager As New Telerik.Cms.CmsManager()  
            ' get the current node of sitemap  
            Dim currentNode As Telerik.Cms.Web.CmsSiteMapNode = DirectCast(SiteMap.CurrentNode, Telerik.Cms.Web.CmsSiteMapNode)  
            ' get the CmsPage represented by the current node and extract its ID  
            Dim currentPage As Telerik.Cms.ICmsPage = currentNode.GetCmsPage()  
            Dim currentPageId As Guid = currentPage.ID  
            ' for demonstration purposes we are going to retrieve the IPage object by passing the  
            ' id of the current object to the GetPage function  
            Dim pageFromDb As Telerik.Cms.IPage = cmsManager.GetPage(currentPageId)  
            ' Else  
            ' End If  
        End Sub  


    Regards

  4. Dale Palmer
    Dale Palmer avatar
    20 posts
    Registered:
    12 May 2008
    06 Feb 2009
    Link to this post
    Can anyone help?
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    09 Feb 2009
    Link to this post
    Hi Dale Palmer,

    Here is the code that returns the ID of the current page.

    Guid pageID = ((Telerik.Cms.Web.UI.PageEditor)(this.Parent.Parent.Parent.Parent.Parent.Parent)).SelectedPageId;  
     

    Just to let you know, Georgi has just sent you a reply to your support request.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Martin Meixger
    Martin Meixger avatar
    7 posts
    Registered:
    27 Sep 2009
    15 Feb 2010
    Link to this post
    @Dale Palmer

    Please check out this post
    I use this 'trick'
Register for webinar
6 posts, 0 answered