Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

Frontend for Files and Images


Go to End


4 Posts   1532 Views

Avatar
spankmaster79

Community Member, 46 Posts

18 November 2010 at 5:52am

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

Avatar
digibrains

Community Member, 130 Posts

18 November 2010 at 8:32pm

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

Avatar
spankmaster79

Community Member, 46 Posts

18 November 2010 at 9:50pm

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?

Avatar
spankmaster79

Community Member, 46 Posts

18 November 2010 at 11:42pm

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?