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

Forums / Developing with Sitefinity / viewing a library item from a generic content item

viewing a library item from a generic content item

12 posts, 0 answered
  1. Mark
    Mark avatar
    24 posts
    Registered:
    16 Jun 2009
    22 Oct 2010
    Link to this post
    Hi,

    We are getting a 404 error when viewing documents stored in the Libraries, we are linking the documents from a generic content item,  the form of the URL after clinking on the link is;

    http://[domain]/[Libraries]fdfe1cf1-596c-437c-8181-90da2b936f2c

    Thanks,

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

    Can you please doublecheck where links are coming from. If they are in the content of a generic content item they would be resolved automatically. It may be the case that you have some custom meta field which should be a link to a CMS resource. In this case you should resolve the link when the content displaying your item is loading. You can find how to resolve the links in this blog post: Resolving the url of dynamic links.

    Kind regards,
    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
  3. Mark
    Mark avatar
    24 posts
    Registered:
    16 Jun 2009
    22 Oct 2010
    Link to this post
    Hi,

    Yep checked the source of the links several times.

    Sorry for my ignorance but are you saying that I have to dynamically parse each link on the page?

    There is no custom meta data.




  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    22 Oct 2010
    Link to this post
    Hello Mark,

    Could you check what is the url format set for your Libraries provider inside the web.config

    Below is the default declaration.

    <cmsEngine defaultProvider="Generic_Content">
            <providers>                      
                <clear/>
                 
                <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"/>

    Does the issue occurs if you try to add a new link for a content item?

    Best wishes,
    Ivan Dimitrov
    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
  5. Mark
    Mark avatar
    24 posts
    Registered:
    16 Jun 2009
    22 Oct 2010
    Link to this post

    Yes it is set to the default.
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    22 Oct 2010
    Link to this post
    Hi Mark,

    Our built-in controls resolve the dynamic links automatically and you do not have to parse them.
    So, do this happens for all items - the newly added and the old one and can you replicate the issue on our demo

    Regards,
    Ivan Dimitrov
    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
  7. Mark
    Mark avatar
    24 posts
    Registered:
    16 Jun 2009
    22 Oct 2010
    Link to this post
    Hi,

    No some of the links work, will upgrading the site to SP4 help?

  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    22 Oct 2010
    Link to this post
    Hello Mark,

    You have made some changes to the HTML, provider urls or content and the links could not be parsed properly. You should update them now as Rado suggested, because upgrading the to the latest official release will not resolve this issue. If you can isolate the issue why some of the links work and why another does not this could give us some more ideas about your issue.

    Kind regards,
    Ivan Dimitrov
    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
  9. Mark
    Mark avatar
    24 posts
    Registered:
    16 Jun 2009
    22 Oct 2010
    Link to this post

    ok I will take a look, no-one would of changed the HTML though as the content producers just use the wizards and the design view as they have no idea how to create the pages using HTML.
  10. Mark
    Mark avatar
    24 posts
    Registered:
    16 Jun 2009
    23 Oct 2010
    Link to this post


    Just had another look and noticed that they are displaying the generic content dynamically, there is a literal in the UI;
    <asp:Literal ID="uxTestIT" runat="server"></asp:Literal>
    then in the code behind they dynamically load the required content; into the literal just as a string;
    uxTestIT.Text = uxTestIT.Text + contentItem.Content.ToString();

    Would I be right in thinking that this is why the URL's are not being resolved. The reason it works in some cases is because the URL's are not dynamic.

    Is there another why to load generic content?

  11. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    24 Oct 2010
    Link to this post
    Hi Mark,

    If you are using a custom code, then you should resolve the links as Rado suggested. We resolve the links for all default controls, but we cannot do this automatically for custom implementations.

    Best wishes,
    Ivan Dimitrov
    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
  12. Mark
    Mark avatar
    24 posts
    Registered:
    16 Jun 2009
    26 Oct 2010
    Link to this post

     have fixed the issue now, I dynamically rebuild the links when the generic content is loaded.

    Thanks for your help.

    MD
Register for webinar
12 posts, 0 answered