Jump to:

23456 Posts in 18905 Topics by 2877 members

General Questions

SilverStripe Forums » General Questions » Menu item link to download document

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2
Go to End
Author Topic: 2329 Views
  • servalman
    Avatar
    Community Member
    211 Posts

    Re: Menu item link to download document Link to this post

    Hello (update)

    I tried and it is not still not working (sometimes I really get lost with ss ;)

    Maybe I was not clear abour my scenario:

    I want to be able to directly link a menu Item (from the site tree) to a pdf document (or any document) so that when the user click on the link he downloads the PDF.

    It should behave like a normal link :

    <a href="assests/upload/mypdf.pdf" target="_blank" > MenuItemLInk </a>.

    I tought it would be a simple task but I really can't sort it out

    Thanks for your help

  • swaiba
    Avatar
    Forum Moderator
    1788 Posts

    Re: Menu item link to download document Link to this post

    I will try that right now but I'm a bit confused about your sugestion to go and see the tutorial.

    The error you posted was about the selection of a file while editing it within the CMS, the tutorial deals with this I believe. The code I wrote was untested and when I remember the tutorial has it - I recommend you that.

    I've had another look and I think if you change 'Root.Content' to 'Root.Content.Main' that might work.

    The point is that I like to help but I'm not here to write code for people - after 200+ posts I'd imagine you'd have debugged code and could get something to work with a few hints. Sorry if I have misread the situation here.

    And if you want to hardcode the file that will be downloaded then go ahead and do that it will save you time.

  • servalman
    Avatar
    Community Member
    211 Posts

    Re: Menu item link to download document Link to this post

    Hello

    1) I'v never asked you to writte any code for me

    2) the only thing I have asked for (original post) was if there was a simple way to create an hyperlink from a menu item to a file in the asset folder like you can do inside a page with the pag editor.

    4) I don't see where in tutorial there is something that has to do with my problem

    3) I think ss is a great piece of software but sometime not easy to apprehend

    Sorry if I'd bothered you, I won't do it again.

    Thanks anyway for your time

  • swaiba
    Avatar
    Forum Moderator
    1788 Posts

    Re: Menu item link to download document Link to this post

    1) I'v never asked you to writte any code for me

    I know I choose to try and help you.

    2) the only thing I have asked for (original post) was if there was a simple way to create an hyperlink from a menu item to a file in the asset folder like you can do inside a page with the pag editor.

    And I've done my best to help you, I'm sorry if you feel me pointing to you a tutorial on how to add field type (upload file) to a page was not good.

    4) I don't see where in tutorial there is something that has to do with my problem

    To choose the file you need something that says "this is the file I want" it could be done many ways but uploading the file and having it associated with the page is a good one I think, if you disagree than as I said hardcode the file.

    3) I think ss is a great piece of software but sometime not easy to apprehend

    I agree, assuming you have completed the tutorials, read the relevant documentation and maybe even one of the books - it will get much better.

  • servalman
    Avatar
    Community Member
    211 Posts

    Re: Menu item link to download document Link to this post

    Hello

    I bought the 2 availiable books on silvertsripe (old and new one)

    I have understood how to upolad a file and display it on a page or create a link on the page to download it.

    the part I don't get (my goal is to have the user click on the menu item link and download file without opening page) is how to link it directly to the menu item without opening a page (a kind of redirector page).

    But maybe this has to do with the way menus behave.

    I'm really trying to do thing by myself and understand what I do

    I won't bother you any more and again sorry if I have been a pain in the ass

    T

    2329 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.