Page 1 of 1

Is it possible to have a hyperlink in the file description?

Posted: 04 Feb 2020, 15:02
by buxster07
If I am using the Download Module and I list a series of files and allow the descriptions to be shown, would it be possible to have a clickable hyperlink in the description displayed?

Currently, when I place a description with a hyperlink, it does not actually show as clickable.

Re: Is it possible to have a hyperlink in the file description?

Posted: 04 Feb 2020, 15:18
by Benno
Hi,
from which Phoca Download Module are you talking?

Kind regards,
Benno

Re: Is it possible to have a hyperlink in the file description?

Posted: 04 Feb 2020, 18:08
by buxster07
Hi Benno,

In this case, I am using the Phoca Download Module. I have a module loaded onto a web page and the module pulls in a file list from a category. This works wonderfully as it has a list of files and their respective descriptions.

Now when I go to Components > Phoca Download > Files, and then I go to a certain file, and edit the description, I attempted to put a hyperlink in the description. But when I go to the web page where the file module resides, the hyperlink is not clickable. Is there a way for the Phoca Download Module to have a hyperlink within a file's description line?

Re: Is it possible to have a hyperlink in the file description?

Posted: 04 Feb 2020, 19:07
by Benno
Hi,
Confirmed! Hyperlinks & BBCode not working. I will ask Jan.
Image

Re: Is it possible to have a hyperlink in the file description?

Posted: 04 Feb 2020, 22:14
by Jan
Hi, which module version do you use?

The description does not include HTML, it is text only. E.g. because when you want to short it and the count of characters is applied:

So the solution can be to remove the strip_tags function:
mod_phocadownload_file.php line cca 280

From:

Code: Select all

if ( $displayDesc == 1 ) {

					$desc	= PhocaDownloadUtils::strTrimAll($v->description);
					$desc 	= strip_tags( $desc );
					if (StringHelper::strlen($desc) < $descCharacters || StringHelper::strlen($desc) == $descCharacters) {
					} else {
						$desc = StringHelper::substr($desc, 0, $descCharacters) . '...';
					}

					$output .= '<div class="pd-mf-desc">'.$desc. '</div>';
				}
To:

Code: Select all

if ( $displayDesc == 1 ) {

					//$desc	= PhocaDownloadUtils::strTrimAll($v->description);
					//$desc 	= strip_tags( $desc );
					//if (StringHelper::strlen($desc) < $descCharacters || StringHelper::strlen($desc) == $descCharacters) {
					//} else {
					//    $desc = StringHelper::substr($desc, 0, $descCharacters) . '...';
					//}

					$output .= '<div class="pd-mf-desc">'.$v->description. '</div>';
				}

Re: Is it possible to have a hyperlink in the file description?

Posted: 04 Feb 2020, 22:33
by buxster07
Hello Jan,

I am using this extension version:
Phoca Download File Module 3.1.8

Re: Is it possible to have a hyperlink in the file description?

Posted: 04 Feb 2020, 22:38
by Benno
Hi,
Jans solution works perfectly with v3.1.8 :)
Image

Kind regards,
Benno

Re: Is it possible to have a hyperlink in the file description?

Posted: 05 Feb 2020, 22:43
by buxster07
Thank you much for the quick response! The script works wonderfully!!!!!

Re: Is it possible to have a hyperlink in the file description?

Posted: 05 Feb 2020, 23:01
by Benno
Thanks for feedback --> Solved!

Kind regards,
Benno