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

Forums / Developing with Sitefinity / Help customizing Library Item Edit template

Help customizing Library Item Edit template

8 posts, 1 answered
  1. andersleet
    andersleet avatar
    155 posts
    Registered:
    03 Jun 2009
    22 Jul 2009
    Link to this post
    Hey all, I am kind of stumped. I am following this tutorial, I added the following info into my web.config file:

    <libraries defaultGenericProvider="Libraries"
       ... 
      <libraryInfo> 
        <add name="FlowPlayer" title="FlowPlayer" defaultExtenstions=".flv" metaKeys="Author, Extension, Name, Size, Category, Description, Test"></add> 
      </libraryInfo> 
     </libraries> 

    also:

    <add key="Libraries.Test" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/> 

    I then added this line to my Telerik.Sitefinity.Configuration.ControlsConfig.xml file:

    <viewSettings hostType="Telerik.Libraries.WebControls.Admin.LibraryItemEdit" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Libraries/LibraryItemEdit.ascx" /> 

    I then edited my LibraryItemEdit.ascx.resx file and set the ItemEdit_Author item's value to "Author!!!!!!".

    I then reset my webserver, but no changes were visible on my edit page. I then added some plain text into the file, and that also did not show up.

    What step(s) did I miss that is preventing my custom admin panel control template from being applied?

    Thanks guys!
    anders
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    22 Jul 2009
    Link to this post
    Hello andersleet,

    1. I cannot see where you have added your custom metakey in the template for LibraryItemEdit.
    2. If you are going to create a custom library type you should use the properties below to specify the path to your custom templates

    libraryItemEditTemplatePath
    libraryItemBatchEditTemplatePath


    Example:

    <add name="Custom" libraryItemEditTemplatePath="~/CustomTemplates/ItemEditTemplate.ascx" title="Custom Library" defaultExtenstions=".*" metaKeys="Author, Description, Extension, Name, Size, Category"></add>  


    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
    Answered
  3. andersleet
    andersleet avatar
    155 posts
    Registered:
    03 Jun 2009
    22 Jul 2009
    Link to this post
    Hi Ivan,

    I believe the second code snippet has the metaKey. Here is a copy of the section of my web.config where it resides:

    <cmsEngine defaultProvider="Generic_Content"
                <providers> 
                    <clear/> 
                    <add name="Generic_Content" urlRewriteFormat="[Publication_Date]/[Name].aspx" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="True" defaultMetaField="Name" securityProviderName="" allowLocalization="False" allowVersioning="True" allowWorkflow="False" allowComments="false" commentsModeration="true" versioningProviderName="" connectionStringName="GenericContentConnection" type="Telerik.Cms.Engine.Data.Providers.DefaultProvider, Telerik.Cms.Engine.Data"/> 
                    <add name="News" urlRewriteFormat="[Publication_Date]/[Title].aspx" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="False" defaultMetaField="Title" securityProviderName="" allowVersioning="True" applicationName="/News" versioningProviderName="" commentsModeration="true" connectionStringName="GenericContentConnection" type="Telerik.News.Data.DefaultNewsProvider, Telerik.News.Data"/> 
                    <add name="Blogs" urlRewriteFormat="[Publication_Date]/[Title].aspx" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="False" defaultMetaField="Title" applicationName="/Blogs" allowVersioning="True" allowComments="true" commentsModeration="false" allowLocalization="False" localizationProviderName="" allowWorkflow="False" securityProviderName="" versioningProviderName="" connectionStringName="GenericContentConnection" type="Telerik.Blogs.Data.DefaultBlogProvider, Telerik.Blogs.Data"/> 
                    <add name="Libraries" urlRewriteFormat="~/{Provider}/{LibraryName}/[Name].sflb.ashx" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="False" defaultMetaField="Name" applicationName="/Libraries" allowVersioning="False" allowLocalization="False" localizationProviderName="" allowWorkflow="False" securityProviderName="" versioningProviderName="" connectionStringName="GenericContentConnection" type="Telerik.Libraries.Data.DefaultProvider, Telerik.Libraries.Data" tagEditorTemplate="~/Sitefinity/Admin/ControlTemplates/Libraries/BatchTagsEditor.ascx"/> 
                    <add name="Events" urlRewriteFormat="[Publication_Date]/[Title].aspx" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="False" defaultMetaField="Title" securityProviderName="" allowVersioning="True" applicationName="/Events" versioningProviderName="" commentsModeration="true" connectionStringName="GenericContentConnection" type="Telerik.Events.Data.DefaultEventsProvider, Telerik.Events.Data"/> 
                </providers> 
                <rssProviders> 
                    <clear/> 
                    <add name="Blogs" type="Telerik.Blogs.RssProvider, Telerik.Blogs" visible="True" applicationName="/Blogs" rssFieldAuthor="Author" rssFieldTitle="Title" rssFieldPubDate="Publication_Date"/> 
                </rssProviders> 
                <browserCacheSettings lastModifiedDateEnabled="true" contentExpirationEnabled="false"
                    <expirationSettings option="ExpireImmediately" value="0"
                    </expirationSettings> 
                </browserCacheSettings> 
                <metaFields> 
                    <add key="Generic_Content.Name" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="Name this content" mandatory="True"/> 
                    <add key="Generic_Content.Description" valueType="LongText" visible="True" searchable="False" sortable="True" defaultValue="Add description here"/> 
                    <add key="Generic_Content.Author" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/> 
                    <add key="Generic_Content.Category" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/> 
                    <add key="News.Title" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/> 
                    <add key="News.Summary" valueType="LongText" visible="True" searchable="True" sortable="True" defaultValue=""/> 
                    <add key="News.Author" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/> 
                    <add key="News.Source" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/> 
                    <add key="News.Publication_Date" valueType="DateTime" visible="True" searchable="True" sortable="True" defaultValue="#Now"/> 
                    <add key="News.Expiration_Date" valueType="DateTime" visible="True" searchable="True" sortable="True" defaultValue="#Max"/> 
                    <add key="News.Thumbnail" valueType="ShortText" visible="True" searchable="False" sortable="False" defaultValue=""/> 
                    <add key="News.Category" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" /> 
                    <add key="News.GalleryID" valueType="ShortText" visible="True" searchable="False" sortable="False" defaultValue="" /> 
                    <add key="Blogs.Title" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/> 
                    <add key="Blogs.Author" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/> 
                    <add key="Blogs.Publication_Date" valueType="DateTime" visible="True" searchable="True" sortable="True" defaultValue="#Now"/> 
                    <add key="Blogs.BlogID" valueType="Guid" visible="False" searchable="True" sortable="True" defaultValue=""/> 
                    <add key="Blogs.Category" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/> 
                    <add key="Blogs.View_Count" valueType="Integer" visible="True" searchable="True" sortable="True" defaultValue="0"/> 
                    <add key="Libraries.Name" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/> 
                    <add key="Libraries.Width" valueType="Integer" visible="True" searchable="True" sortable="True" defaultValue=""/> 
                    <add key="Libraries.Height" valueType="Integer" visible="True" searchable="True" sortable="True" defaultValue=""/> 
                    <add key="Libraries.Size" valueType="Integer" visible="True" searchable="True" sortable="True" defaultValue=""/> 
                    <add key="Libraries.Extension" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/> 
                    <add key="Libraries.AlternateText" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/> 
                    <add key="Libraries.Author" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/> 
                    <add key="Libraries.Description" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/> 
                    <add key="Libraries.Category" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/> 
                    <add key="Libraries.PermaLink" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/> 
                    <!-- This is my new metaKey --> 
                    <add key="Libraries.Test" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/> 
                    <!-- End new metaKey --> 
                    <add key="Events.Title" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/> 
                    <add key="Events.Street" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/> 
                    <add key="Events.City" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/> 
                    <add key="Events.Country" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/> 
                    <add key="Events.State" valueType="ShortText" visible="True" searchable="True" sortable="False" defaultValue=""/> 
                    <add key="Events.Geomapping_Data" valueType="ShortText" visible="True" searchable="False" sortable="False" defaultValue=""/> 
                    <add key="Events.Event_Start" valueType="DateTime" visible="True" searchable="True" sortable="True" defaultValue="#Now"/> 
                    <add key="Events.Event_End" valueType="DateTime" visible="True" searchable="True" sortable="True" defaultValue="#Now"/> 
                    <add key="Events.Publication_Date" valueType="DateTime" visible="True" searchable="True" sortable="True" defaultValue="#Now"/> 
                    <add key="Events.Expiration_Date" valueType="DateTime" visible="True" searchable="True" sortable="True" defaultValue="#Max"/> 
                    <add key="Events.Contact_Name" valueType="ShortText" visible="True" searchable="False" sortable="False" defaultValue=""/> 
                    <add key="Events.Contact_Email" valueType="ShortText" visible="True" searchable="False" sortable="False" defaultValue=""/> 
                    <add key="Events.Contact_Phone" valueType="ShortText" visible="True" searchable="False" sortable="False" defaultValue=""/> 
                    <add key="Events.Contact_Cell" valueType="ShortText" visible="True" searchable="False" sortable="False" defaultValue=""/> 
                    <add key="Events.Contact_Web" valueType="ShortText" visible="True" searchable="False" sortable="False" defaultValue=""/> 
                    <add key="Events.Category" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/> 
                </metaFields> 
                <contentViewSettings> 
                    <add type="Telerik.Cms.Engine.WebControls.Design.Settings.TextSettingService"/> 
                    <add type="Telerik.Cms.Engine.WebControls.Design.Settings.ContentSettingService"/> 
                    <add type="Telerik.Cms.Engine.WebControls.Design.Settings.MaxWidthSettingService"/> 
                </contentViewSettings> 
            </cmsEngine> 

    So, with your code snippet where does this reside? Inside the <libraryInfo> tag?

    Thanks!
    anders

  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    22 Jul 2009
    Link to this post
    Hello andersleet,

    The code snipped should be used only in case you are adding new library type. It have to be added between libraryInfo web.config's node.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. andersleet
    andersleet avatar
    155 posts
    Registered:
    03 Jun 2009
    22 Jul 2009
    Link to this post
    Thats what I thought. I created a new library to upload .flv files to it in order to utilize a third-party video player.

    Anyway, what am I missing that is preventing my changes from showing up in the admin panel? Do I have to change the verbage in my third code snippet (from the original post) from 'layoutTemplatePath' to 'libraryItemEditTemplatePath'?

    Thanks again!
    anders
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    23 Jul 2009
    Link to this post
    Hello andersleet,

    Please take a look at provided example. It shows that you should use libraryItemEditTemplatePath

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  7. Carl Leth
    Carl Leth avatar
    3 posts
    Registered:
    11 May 2010
    03 Aug 2010
    Link to this post
    Is there any way to associate other templates to a specific libraryInfo tag?  There are 6 templates associated with a library:
    LibraryItemBatchEdit
    LibraryItemEdit
    LibraryItemHistory
    LibraryItemList
    LibraryItemPreview
    LibraryItemUpload

    It seems like LibraryItemBatchEdit and LibraryItemEdit are the only ones you can set on a per-library-type basis.  How would I go about showing a different ItemList for two different library types?

    Thanks,
    Carl Leth
  8. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    06 Aug 2010
    Link to this post
    Hello Carl Leth,

    Thank you for using our services.

    This would require that you build a custom control which inherits from LibraryItemList control and get the type of the library you are displaying. Then based on this make your views. You can find information on how to replace view controls in this blog post: Replacing a child view with another one.

    Greetings,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
8 posts, 1 answered