Fórum

Documents and Media Portlet View Button

Ryan Smith, modificado 7 Anos atrás.

Documents and Media Portlet View Button

New Member Postagens: 8 Data de Entrada: 28/07/16 Postagens Recentes
When the view button on the Documents and Media Portlet is clicked it will just reload the page. Is there a way to prevent this and have it actually open the document?
I was originally thinking of using javascript to grab the url from the input field value and replacing the view button's href with the value, but I can't seem to access the DOM element of the input field. (Even if this worked, I'd have to check to see if it was an image, pdf, or doc/docx file because doc/docx files instantly download, which is not what I want).

I must be overthinking this, is there an easier way to get the view button to open a new tab that has the document displayed?
thumbnail
Samuel Kong, modificado 7 Anos atrás.

RE: Documents and Media Portlet View Button

Liferay Legend Postagens: 1902 Data de Entrada: 10/03/08 Postagens Recentes
Ryan Smith:
When the view button on the Documents and Media Portlet is clicked it will just reload the page.


It's not reloading the page. The information for the older version of the file is loaded. Try adding additional versions of the file and you'll probably get a better idea of what's going on.

Is there a way to prevent this and have it actually open the document?

If you want to open the document, use the 'Download' button (located left of the View button).
Ryan Smith, modificado 7 Anos atrás.

RE: Documents and Media Portlet View Button

New Member Postagens: 8 Data de Entrada: 28/07/16 Postagens Recentes
Samuel Kong:

If you want to open the document, use the 'Download' button (located left of the View button).


That seems a little misleading, because I don't want my users to download the documents, but be able to view them outside the previewer. For example if it's a word document, it should be viewable online instead of it instantly attempting to download the document.
There seems to be issues with the previewer when the documents are pdfs as well. Sometimes the preview displays the document incorrectly.

There should be a way to view all documents online without the need to download. Could you tell me if there is a way to do this?
thumbnail
Samuel Kong, modificado 7 Anos atrás.

RE: Documents and Media Portlet View Button

Liferay Legend Postagens: 1902 Data de Entrada: 10/03/08 Postagens Recentes
If you just want a preview of the document, than the page in your screenshot will already show a preview of the document.

On the other hand, if you want Microsoft Word to open the document from within the browser, than that's outside the scope of Liferay. This is something that needs to be configured in the browser and is not something you can change from the portal.
Ryan Smith, modificado 7 Anos atrás.

RE: Documents and Media Portlet View Button

New Member Postagens: 8 Data de Entrada: 28/07/16 Postagens Recentes
Ryan Smith:

There seems to be issues with the previewer when the documents are pdfs as well. Sometimes the preview displays the document incorrectly.


The previewer doesn't always work. It often times displays incorrectly. This is why there should be a way to access another way to view a document without the need to download. The application of word is not required to view word documents, there are ways to read doc/docx or other text files online.
thumbnail
Samuel Kong, modificado 7 Anos atrás.

RE: Documents and Media Portlet View Button (Resposta)

Liferay Legend Postagens: 1902 Data de Entrada: 10/03/08 Postagens Recentes
What have you configured to generate to the preview. Liferay provides several options and you can also plug in a custom previewer if you want. See 'dl.file.entry.processors' in portal.properties for more info.