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

Forums / General Discussions / News Module: pdf upload

News Module: pdf upload

21 posts, 0 answered
  1. shraddha
    shraddha avatar
    87 posts
    Registered:
    18 May 2009
    11 May 2010
    Link to this post
    Hi,
    I am using sitefinity news module. Here on click of heading of perticular news instead of showing complete content, I want open a pdf files.
    How do I add this pdf upload functionality to news module???

    --Thanx
    Shraddha
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    11 May 2010
    Link to this post
    Hello shraddha,

    You could override SetItemMetaData method of NewsView control and replace the title/fullCotnent  with a hyperlink that points to a pdf file.

    Note that this forum is for Sitefintiy 4.0 CTP and neither CTP not Sitefinity 3.x supports this feature out of the box.

    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.
  3. shraddha
    shraddha avatar
    87 posts
    Registered:
    18 May 2009
    11 May 2010
    Link to this post
    Hi,
    I am using sitefinity 3.7 SP3, so cant I have this feature of pdf upload and link on heading feature????

    -- Thanx
    Shraddha
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    11 May 2010
    Link to this post
    Hello shraddha,

    We will consider your request for future implementations. Currently you could override SetItemMetaData method and access the contentItem object to achieve your goal.

    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. shraddha
    shraddha avatar
    87 posts
    Registered:
    18 May 2009
    11 May 2010
    Link to this post
    Hi Ivan,
    Thanx for the reply.
    That is for the display part. But how can I upload pdf file in news module when I add/ Edit any news????

    --Thanx
    Shraddha
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    11 May 2010
    Link to this post
    Hello shraddha,

    You could create a new metakey with ButtonSelector control and upload fines to the file system or one of your libraries.

    <li class="selector">
                          <asp:Label ID="Label2" AssociatedControlID="PDFField" runat="server"><asp:Literal ID="Literal14" runat="server" Text="<%$Resources:Thumbnail %>"></asp:Literal> <em id="PDFFieldLabel" runat="server"></em></asp:Label>
                          <asp:TextBox ID="PDFField" Text="" runat="server" MaxLength="250"></asp:TextBox>
                          <sfLib:ButtonSelector WindowNavigateUrl="~/Sitefinity/UserControls/Dialogs/DocumentEditorDialog.aspx" ItemTemplatePath="~/Sitefinity/Admin/ControlTemplates/News/Dialogs/ButtonSelector.ascx" AssociatedControls="PDFField" runat="server" cssclass="pickerWrapper" ButtonText="<%$Resources:Select%>" />
                          <p class="example">
                              <asp:Literal ID="Literal15" runat="server" Text="<%$Resources:PDFFieldNote %>"></asp:Literal>
                          </p>
                      </li>


    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.
  7. shraddha
    shraddha avatar
    87 posts
    Registered:
    18 May 2009
    12 May 2010
    Link to this post
    Hi,
    Thanx for the solution. Now I can upload and view pdf files through news module.
    But how do I change default file upload path from "~/Files " to some other folder???


    --Thanx
    Shraddha
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    12 May 2010
    Link to this post
    Hello shraddha,

    Please take a look at this post ImageEditorDialog default upload path

    All the best,
    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. shraddha
    shraddha avatar
    87 posts
    Registered:
    18 May 2009
    12 May 2010
    Link to this post
    Hi,
    Thanx for the reply.
    I have tried using sample given by you. But I guess there is some issue in registering that custom control in namespace. What can be the namespace for that??
    Also in my case I have to modify DocumentEditorDialog control instead of ImageEditorDialog. In custom control, what should I use instead of "Telerik.Libraries.WebControls.ImageEditorDialog"????


    -- Thanx
    Shraddha. 
     
  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    12 May 2010
    Link to this post
    Hi shraddha,

    There is DocumentEditorDialog, but it wraps ImageEditorDialog in it, so you should look for ImageEditorDialog

    Sincerely yours,
    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.
  11. shraddha
    shraddha avatar
    87 posts
    Registered:
    18 May 2009
    12 May 2010
    Link to this post
    Hi Ivan, Thanx.. I will use ImageEditorDialog control only.. But what about the namespace for registering the custom control???



    -Thanx
    Shraddha
  12. shraddha
    shraddha avatar
    87 posts
    Registered:
    18 May 2009
    14 May 2010
    Link to this post
    Hi,
    My default path for DocumentEditorDialog has been changed. Thanx a lot for your help.
    But now my image upload control is not taking default path i.e. ~/Images. It is taking some other selected library by default. I can change that path but why it is not taking default path??
    Are changed made for DocumentEditorDialog control affecting imageEditorDialog control anywhere??


    --Thanx
    Shraddha
  13. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    14 May 2010
    Link to this post
    Hi shraddha,

    Can you share the code that you have to set the default path?

    Greetings,
    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.
  14. shraddha
    shraddha avatar
    87 posts
    Registered:
    18 May 2009
    14 May 2010
    Link to this post
    Hi,
    Check this code to set default upload folder

    protected override void CreateChildControls()
           {
               Control parent = this.Parent;
               while (parent != null && !(parent is Panel))
               {
                   parent = parent.Parent;
               }
               dialog = parent as Panel;
               // change the default folder for upload 
               parent = this.Parent;
               while (parent != null && !(parent is ImageEditorDialog))
               {
                   parent = parent.Parent;
               }
               UploadFolder = parent as ImageEditorDialog;
               UploadFolder.DefaultUploadFolder = "~/Upload/News/";
               // call the base class and set the property 
               base.SelectAllItemsText = UploadFolder.DefaultUploadFolder;
               base.CreateChildControls();
           }
  15. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    14 May 2010
    Link to this post
    Hello shraddha,

    Have you modified the code in Sitefinity\Admin\ControlTemplates\Libraries\Dialogs\DocumentEditorDialog.ascx from where you should call the CustomBaseGuildSelector class.

    Sincerely yours,
    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.
  16. shraddha
    shraddha avatar
    87 posts
    Registered:
    18 May 2009
    14 May 2010
    Link to this post
    Hi Ivan,
    Yes, I have modified the control "DocumentEditorDialog.ascx"
    1. I have added register entry
    <%@ Register Assembly="App_Code" Namespace="Telerik.Libraries.WebControls" TagPrefix="sfLib" %>

     2. changed

    <

     

    sfLib:LibrarySelector to <sfLib:CustomBaseGuidSelector

    3. Literal with id="selectedValue" made visible="false"

    4. Added 1 Literal after that

     

    <asp:Literal ID="LibName" runat="server" Text="~/Upload/News/" ></asp:Literal>


    -- Thanx
    Shraddha

     

     

     

     

  17. shraddha
    shraddha avatar
    87 posts
    Registered:
    18 May 2009
    30 Jun 2010
    Link to this post
    Hi,
    I got the problem.. In both Image and file upload box, there are two options to upload file/Image.
    one is physical location and the other is any of the library. What happens is, when there is any library created in website, it by default keeps library option selected and if we dont change that it uploads file/image in library and add its ID in field. I know I can change that option but I want that physical path option seleced by default.
    How can I achieve this?

    --Thanx
    Shraddha
  18. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    30 Jun 2010
    Link to this post
    Hello shraddha,

    Since you are setting UploadFolder.DefaultUploadFolder only the physical directories should be selected.

    All the best,
    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
  19. shraddha
    shraddha avatar
    87 posts
    Registered:
    18 May 2009
    30 Jun 2010
    Link to this post

    Hi,

    I am setting default upload folder, but still it is using library by default.

    please check attached screen shot of my news page.

     

     

    --Thanx

    Shraddha

  20. shraddha
    shraddha avatar
    87 posts
    Registered:
    18 May 2009
    02 Jul 2010
    Link to this post
    Hi,
    In addition to that, I also want file remove option, which will remove file from that physical location.
    And when someone try to upload file with the already existing file name, it should give a promt that "file already exists!!"
    Is it possible???

    -Thanx
    Shraddha
  21. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    02 Jul 2010
    Link to this post
    Hello shraddha,

    The built-in dialog does not support these features out of the box. You will need completely new custom dialog. You can reuse ImageEditorDialog and override its CreateChildControls. There you can subscribe for  container.UploadButton.Command and implement FileExists check. You can remove files by using File.Delete Method or implement FileExplorer control which supports CRUD operation.

    Greetings,
    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
Register for webinar
21 posts, 0 answered