[File plugin] get path to display PDF in Fancybox

More
11 years 3 months ago #45686 by yopyop001
Hi,

I have a content type with a file field (PDF).
I need to open the file for reading in a fancybox. (and download / send button too). It will be a 'Quick view' button...

In $item->fields, there is a value to download () but not the path to the file. Is there a way to get it in item template?

Thanks a lot.

Regards

Please Log in or Create an account to join the conversation.

More
11 years 3 months ago #45689 by ggppdk
Hello
Code:
$item->fields['field_name']->url
is an array that was added for a similar developer need,

-- what you ask/suggest makes sense to add and will be in v2.1.3 final, to add it now edit plugin file:
.../flexicontent_fields/file/file.php

and after:
Code:
$field->url[] = $dl_link;
add:
Code:
$basePath = $file_data->secure ? COM_FLEXICONTENT_FILEPATH : COM_FLEXICONTENT_MEDIAPATH; $file->abspath[] = str_replace(DS, '/', JPath::clean($basePath.DS.$file_data->filename));

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
11 years 3 months ago #45690 by yopyop001
Thanks Georgios,

Just a little mistake :

Replace
Code:
$file->abspath[] = str_replace(DS, '/', JPath::clean($basePath.DS.$file_data->filename));
By
Code:
$field->abspath[] = str_replace(DS, '/', JPath::clean($basePath.DS.$file_data->filename));

Now looking for a pdf viewer able to open and display the file (even if there are in secure folder)

Regards

Please Log in or Create an account to join the conversation.

More
11 years 3 months ago #45699 by micker
good idea pdf in modal !

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
11 years 3 months ago #45702 by ggppdk
Hello

r1683, added this without any extra JS lib:

to give more details, it was added as 1 more action to file field:
- in-browser viewing
(we already have)
- download
- share
- add to download cart (needs download cart module)


-- did the above, since all recent version of firefox / chrome / ie / etc have built-in PDF viewer , and older ones have some PDF plugin installed (e.g. adobe acrobat)

the view will open in a popup box and browser will be asked to display it inline (content-disposition HTTP header is to 'inline' = view , instead of 'attachment' = download)


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.348 seconds
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save