1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / New module or 'modify' an existing

New module or 'modify' an existing

11 posts, 0 answered
  1. Simon
    Simon avatar
    28 posts
    Registered:
    27 Jun 2008
    21 Aug 2008
    Link to this post
    I need to create a job Vacancies module. In terms of functionality it is quite similar to the Events module in that each vacancy has a Title, Description, Location, Contact details and Start and End date/time. I don't need any of the other functionality: Categories, Tags or Comments. But I need to attach a pdf.

    Rather than directly modify this module, which might cause upgrade problems later on, I would like to copy it and modify things to suit my requirements. Is it as simple as copying the Events folder from ~/Sitefinity/Admin/ControlTemplates/Events to my own cusomisations folder ~/UserControls?

    I have looked at the help file for creating custom modules http://www.sitefinity.com/help/developer-manual/adding-new-modules-overview.html and downloaded the bare bones example. But that says I need to have an App_Code folder which I don't have, so it would seem that the Events module isn't using the format described in the tutorial...
  2. Sonya
    Sonya avatar
    231 posts
    Registered:
    24 Sep 2012
    22 Aug 2008
    Link to this post
    Hi Simon,

    Unfortunately, it is not as easy as copy-pasting a folder in order to create and modify an existing module in Sitefinity. There are two possible ways to create what you have described:
    1. Create a module that is based on Generic Content (as is Events). Instructions on how to do that, as well as sample code, could be found in the section Generic Content Based Modules Creation  of the Developer Manual.
    2. Create a new provider for an existing module. You could find an example of how to do that in the section Customizing modules in the User Manual.
    Hope this helps. Let us know if you need further assistance.

    Regards,
    Sonya
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Simon
    Simon avatar
    28 posts
    Registered:
    27 Jun 2008
    22 Aug 2008
    Link to this post
    Hi Sonya,

    Thanks for your reply.
    Option 1 sounds like the most attractive solution to me. I had looked at the sample code from that link before posting my thread, but I thought it stoped short of what I needed.

    Is there a revised expected date for the later samples in the series. Particularly the simple implementation with enabled permissions and workflow?
    as I think this would most closely fit my needs
  4. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    26 Aug 2008
    Link to this post
    Hello Simon,

    We are working on these samples and we hope we'll be able to post them as soon as possible. I am sorry for the inconvenience.

    Greetings,
    Ivan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Simon
    Simon avatar
    28 posts
    Registered:
    27 Jun 2008
    26 Aug 2008
    Link to this post
    Hi Ivan,

    I appreciate the hard work you're all putting in to this, it all makes my life as a developer much easier.


  6. Simon
    Simon avatar
    28 posts
    Registered:
    27 Jun 2008
    27 Aug 2008
    Link to this post
    I have been trying to follow the Products Module and change it to suit my requirements. I downloaded the sample code and created a new project, replicated the structure and recreated all the files, but using VB.NET

    I also copied the contents of the Telerik.Samples.Products/bin/debug folder into my own ifs.Vacancies/bin/debug folder, but removed the Telerik.Rss.dll and Telerik.Samples.Products.dll files as I will not be needing them.

    As I was building the project I needed some of the dll's from the main website, so created a lib folder at the root level, so I now have 3 folders
    1. 1. ifs.Vacancies(Telerik.Samples.Products)
    2. 2. lib
    3. 3. WebPages (Website)

    My project compiles successfully.

    Next I wanted to integrate this with my existing website so, following the instructions on this page: http://www.sitefinity.com/help/developer-manual/products-module-simple-implementation.html

    Added the following line to the configuration/configSections/sectionGroup name=”telerik” element
    <section name="vacancies" type="ifs.Vacancies.Configuration.SectionHandler, ifs.Vacancies" requirePermission="false" /> 

    Added the following line to the telerik/framework/modules element
    <add type="ifs.Vacancies.VacanciesModule, ifs.Vacancies" /> 

    Added the following line to the telerik/cmsEngine/providers element:
    <add name="Vacancies" urlRewriteFormat="[Job_Title].aspx" urlWhitespaceChar="_"  
        urlDateTimeFormat="dd-MMM-yyyy" allowVersioning="False" allowWorkFlow="False"     
        allowComments="false" defaultMetaField="JobTitle" securityProviderName=""  
        applicationName="/Vacancies" versioningProviderName="" commentsModeration="false" 
        connectionStringName="GenericContentConnection" visible="false" 
        type="Telerik.Cms.Engine.Data.Providers.DefaultProvider, Telerik.Cms.Engine.Data" /> 

    Added the following lines to telerik/cmsEngine/metaFields element:
    <add key="ifs.Job_Title" valueType="ShortText" visible="True" searchable="True"  sortable="True" defaultValue="Name this vacancy" mandatory="True" /> 
    <add key="ifs.Job_Description" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" /> 
    <add key="ifs.Job_Specification"  valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" /> 
    <add key="ifs.Street" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" /> 
    <add key="ifs.City" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" /> 
    <add key="ifs.Country" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" /> 
    <add key="ifs.County" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" /> 
    <add key="ifs.Publication_Date" valueType="DateTime" visible="True" searchable="True" sortable="True" defaultValue="#Now" /> 
    <add key="ifs.Expiration_Date" valueType="DateTime" visible="True" searchable="True" sortable="True" defaultValue="#Max" /> 
    <add key="ifs.Contact_Name" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" /> 
    <add key="ifs.Contact_Email" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" /> 
    <add key="ifs.Contact_Phone" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" /> 

    Added the following lines to telerik element:
    <vacancies defaultGenericProvider="Vacancies"
        <genericContentProviders> 
            <add providerName="Vacancies" urlRewriteFormat="[Job_Title].aspx" urlDateTimeFormat="dd-MMM-YYYY HH:mm" urlWhitespaceChar="_" /> 
        </genericContentProviders> 
    </vacancies> 

    Copied the following folder from the project you have downloaded:
    WebPages/ControlTemplates/Vacancies
    and pasted it to this folder in your Sitefinity website:
    ~/Sitefinity/ControlTemplates

    1. Copied the following folder from the project you have downloaded:
      WebPages/Admin/ControlTemplates/Vacancies
      and pasted it to this folder in your Sitefinity website:
      ~/Sitefinity/Admin/ControlTemplates

    2. Added the following file in your Sitefinity website:
      ~/Sitefinity/Admin/Themes/Default/Modules.css
      and made sure I have added the styles for Vacancies module in the first five lines.

    Now I am stuck at this point (Number 12)
    Add new project to your website in Visual Studio. In the existing project dialog choose the file that came with the project you have downloaded:
    Telerik.Samples.Products/Telerik.Samples.Products.csproj

    I cannot add a new project to my website in Visual Studio. Add an existing item allows me to browse files on my computer, but selecting the vbproj file just includes that file in my website. Add a new item menu brings up options for html pages, user controls, sitemap etc, but not Project files. And if I try to add a Reference for the dll from my bin folder it loads the dll but does not give me the chance to update references to the other dll files.

    And now I am getting the following YSOD when trying any of the pages

    Could not load file or assembly 'Telerik.DataAccess, Version=3.2.1598.2, Culture=neutral, PublicKeyToken=dfeaee0e3978ac79' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.IO.FileLoadException: Could not load file or assembly 'Telerik.DataAccess, Version=3.2.1598.2, Culture=neutral, PublicKeyToken=dfeaee0e3978ac79' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Assembly Load Trace: The following information can be helpful to determine why the assembly 'Telerik.DataAccess, Version=3.2.1598.2, Culture=neutral, PublicKeyToken=dfeaee0e3978ac79' could not be loaded.

    WRN: Assembly binding logging is turned OFF.
    To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
    Note: There is some performance penalty associated with assembly bind failure logging.
    To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].


    What do I need to do to get this new module working?

  7. Simon
    Simon avatar
    28 posts
    Registered:
    27 Jun 2008
    28 Aug 2008
    Link to this post
    I have backed out all of my changes, but I am still getting the same error.
    I am escalating this to a support ticket as I need to
    a) make my site work again
    b) get my module working
  8. Simon
    Simon avatar
    28 posts
    Registered:
    27 Jun 2008
    28 Aug 2008
    Link to this post
    Ok in pure desparation I have copied ALL the files from the bin folder of another Sitefinity website into my bin and the website works.

  9. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    01 Sep 2008
    Link to this post
    Hello Simon,

    I am closing this forum thread as we have answered your request on the support ticket.

    Best wishes,
    Ivan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  10. Jake
    Jake avatar
    1 posts
    Registered:
    29 Mar 2007
    21 Sep 2008
    Link to this post
    What is the solution to this issue?
  11. Simon
    Simon avatar
    28 posts
    Registered:
    27 Jun 2008
    22 Sep 2008
    Link to this post
    Hi Jake,

    I fixed the problem with my site now working by copying ALL the contents of another copy of my bin folder to the site that wasn't working. Which is a bit like using an angle grinder to open a tin of beans... but at least got my site running again.

    As for the more general problem with trying to create a Vacancies module, well that's still ongoing. Unfortunately I am trying to convert the examples provided to VB.Net at the same time as changing the functionality, which complicates things.
Register for webinar
11 posts, 0 answered