123 Posts
EclipseMedia
7 years ago
Topic

This is not working in FREE TEXT . Basically I want to create a link to open a PDF a user has uploaded.

<a href="/$cck->getValue('specsheet_pdf');" target="_blank">$cck->getValue('specsheet_pdf_title');</a>

Get a VIP membership
1283 Posts
Bucklash
7 years ago
0
Level 1

Hi

This is the exact text I use in my free text field, stored in default value

<a href="/lesson-files/$cck->getValue('art_alias');" type="button" class="btn btn-primary"> <i class="fa fa-file"> </i>View Page</a>

123 Posts
EclipseMedia
7 years ago
0
Level 1

Thanks for your help, however it still does not work

Output address becomes
$cck-%3EgetValue('specsheet_pdf');

It should be
index.php?option=com_cck&task=download&file=specsheet_pdf&id=32

I'm not sure why its not putting out the proper address.

1283 Posts
Bucklash
7 years ago
0
Level 1

Hu

So %3E is the same as '>'. 

I wonder then if text editor or some pligin outside of Seblod is changing it...

Maybe a plugin order needs changing?

4229 Posts
Kadministrator
7 years ago
0
Level 1

Try using another editor, it seems your default editor is encoding inserted characters. Usually there is also an option in editor do disable that or "edit source" mode where you can edit code source directly.

123 Posts
EclipseMedia
7 years ago
0
Level 1

I use JCE editor and I did "toggle editor" to input the raw code (not wysiwyg) . However I did change my editor to None and re-attempted to add the code but the output is the same. :(

123 Posts
EclipseMedia
7 years ago
0
Level 1

The field I'm trying to get data from is a "File Upload" field. Is that causing issues.

The bottom line is, is I want people to see "Download File" link instead of seeing the actual file link to download.

4229 Posts
Kadministrator
7 years ago
0
Level 1

Which seblod version do you use? Fretext field filtering was removed in latest version only.

If what you would like to do is in content view, you can use html typography on upload field and set it to use this fields value

<a href="/*value*" target="_blank">$cck->getValue('specsheet_pdf_title');</a>

Another thing to try - if I remember correctly upload field does not have value property, it has link, so try

$cck->getLink('specsheet_pdf')

123 Posts
EclipseMedia
7 years ago
0
Level 1

PERFECT!!!! Thank you Klas!! Using the HTML typography is way better and limits the need for more fields! Works great

Get a Book for SEBLOD