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

Forums / Developing with Sitefinity / Extensionless url for blog single view

Extensionless url for blog single view

3 posts, 1 answered
  1. Daniel Plomp
    Daniel Plomp avatar
    112 posts
    Registered:
    14 Jun 2012
    11 Oct 2010
    Link to this post
    Hi all,

    I have configured Sitefinity for using extensionless URL's on IIS7.
    Works okay for pages, but not when navigating from a BlogList to a BlogSingleItem. Then the extension is visible again.

    I changed this inside my BlogList class like this:
    protected override void SetItemContent(System.Web.UI.Control itemContainer, Telerik.Cms.Engine.IContent contentItem)
    {
       base.SetItemContent(itemContainer, contentItem);
       string navUrl = Utility.ResolveItemUrl(SingleItemUrl, contentItem.Url, true);
      
       //GetItemUrl(contentItem, SingleItemUrl);
       for (int i = 1; i < 6; i++)
       {
          var ctrl = FindContentViewControl("fullContent" + i, itemContainer);
          if (ctrl is HyperLink)
          {
             ((HyperLink)ctrl).NavigateUrl = navUrl.ToLower();
          }
       }
    }

    Now the same problem occurs with e.g. the TagList. So, should I create a custom class for every control that links or filters to blogitems? Is there some other setting to do it for all modules, all at once?

    Thanks,
    Daniel

  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    11 Oct 2010
    Link to this post
    Hi Daniel Plomp,

    When you move to extensionless urls you have to also change the way how the urls to generic content based module items are formed:
    <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="true" 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]{Extension} " 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"/>
            <!--Amazon Data Provider [First turn off the default one] url format can be urlRewriteFormat="~/{Provider}/{LibraryName}/[Name].s3lb" as well in that cae there will extra libraries in the url-->
            <!--<add name="Libraries" urlRewriteFormat="~/{LibraryName}/[Name].s3lb"  thumbnailExtension=".tmb" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="False" defaultMetaField="Name" applicationName="/Libraries" allowVersioning="True" allowLocalization="False" localizationProviderName="" allowWorkflow="False" securityProviderName="" versioningProviderName="" connectionStringName="GenericContentConnection" type="Telerik.Libraries.Data.AmazonProvider, Telerik.Libraries.Data" tagEditorTemplate="~/Sitefinity/Admin/ControlTemplates/Libraries/BatchTagsEditor.ascx" />-->
            <!--Viddler Data Provider Compatible with other libraries, must add a libraryInfo with type = "Viddler"-->
            <!--<add name="Libraries" urlRewriteFormat="~/{LibraryName}/[Name].sflb.ashx" thumbnailExtension=".tmb.ashx" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="False" defaultMetaField="Name" applicationName="/Libraries" allowVersioning="True" allowLocalization="False" localizationProviderName="" allowWorkflow="False" securityProviderName="" versioningProviderName="" connectionStringName="GenericContentConnection" type="Telerik.Libraries.Data.ViddlerProvider, 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" allowComments="true" versioningProviderName="" commentsModeration="true" connectionStringName="GenericContentConnection" type="Telerik.Events.Data.DefaultEventsProvider, Telerik.Events.Data"/>
            <add name="Wiki" urlRewriteFormat="[Wiki]/[Name].aspx" urlWhitespaceChar="_" visible="False" defaultMetaField="Name" securityProviderName="" allowVersioning="True" applicationName="/Wiki" versioningProviderName="" allowComments="true" commentsModeration="true" connectionStringName="GenericContentConnection" dataFile="~/App_Data/Wikis.xml" type="Telerik.Wiki.Data.XmlProvider, Telerik.Wiki.Data"/>
        </providers>


    All the best,
    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
    Answered
  3. Daniel Plomp
    Daniel Plomp avatar
    112 posts
    Registered:
    14 Jun 2012
    12 Oct 2010
    Link to this post
    Thanks, that worked.

    Regards,
    Daniel
Register for webinar
3 posts, 1 answered