Jump to:

23552 Posts in 19349 Topics by 2891 members

General Questions

SilverStripe Forums » General Questions » Frontend for Files and Images

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
Go to End
Author Topic: 1146 Views
  • spankmaster79
    Avatar
    Community Member
    46 Posts

    Frontend for Files and Images Link to this post

    Hi,

    is there a way to "publish" files from the files and images manager to the frontend? I don't want them connected to a page, but instead use an option for the files, like a publish feature to display the content in the frontend. So in the end there would be one page that shows all published files from the backend and then let them be searched through...

    Any suggestions how to do this?

    Kind regards
    Spnaky

  • prawnstar
    Avatar
    Community Member
    116 Posts

    Re: Frontend for Files and Images Link to this post

    When you say ""publish" files from the files and images manager" are you asking if you can upload a file within the file manager and have that file be accessed via a URL that displays the content of that file?

    You can access that file via an URL, such as http://www.yourSSsite.com/assets/Uploads/yourfile.pdf. And if your browser is configured to read/display pdf's you would see a pdf(provided your URL was accurate), otherwise I believe your browser asks you what to do with the file you are requesting (I.e., download the file or open the file with a preferred application).

    Hope that helps.

    Chris.b

  • spankmaster79
    Avatar
    Community Member
    46 Posts

    Re: Frontend for Files and Images Link to this post

    What I meant is to have a page where I can view all documents uploaded in the backend. A page with a list of documents that can be searched also would be nice.

    I already know how to attach a file to a page with the dataobject_manager module. But using this, I would have to add all files to my page manually. But what I want is to have all documents viewable in the frontend automatically. So if I upload a document in the backend it is automatically in the list of documents, but only if a "published" flag is set.

    The "published" flag would then only make it possible to hide documents from the frontend. If a document is not published, it is not shown in the page.

    Any idea?

  • spankmaster79
    Avatar
    Community Member
    46 Posts

    Re: Frontend for Files and Images Link to this post

    Ok, I found out that I can get all Uploaded files through:

    DataObject::get('File');

    and return the DataObjectSet to the View and generate output.

    But how can I extend File to have special properties? Like tags, published state, and everything else I want...... I Know I could extend File but would the files then still be managable in the backend through the global upload?

    1146 Views
Page: 1
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.