You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Online

Official support hours
Monday to Friday
09:00 - 17:00 Europe/London (BST)

#101632 Create Override for JCE Media Field Plugin

Posted in ‘Editor’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by Ryan on Friday, 08 November 2019 20:07 GMT

li_gordon
I want to create an override for the jcemedia field plugin. Instead of displaying the filename, I want to display a 'fixed' title, such as, click here for cv file. I created an override for the url field type with the following code:

/* Define a variable: Link Display, this is the 'display' that will be shown.
--> If the description is Blank, assign the web url (or stripped email) to the linkdisplay
--> If it contains a value then use that value as the link display */

if ($desc =='')
{ $linkdisplay = $value_substring;
} else
 {$linkdisplay = $desc;
}

/** code that works from 10/18/2018 */
echo sprintf('<a href="https://www.joomlacontenteditor.net/%s"%s>%s</a>',
    htmlspecialchars($value),
    $attributes,
    $linkdisplay
);
When I tried to create an override for the jce media plugin, I see that the layout is quite different. Basically I want to do the following... 1. IF it is a 'file' type field 2. IF the DESCRIPTION is NOT NULL 3. Then I want to use the 'DESCRIPTION' as the link text (not the actual file name). Unless you have another way you would recommend doing this. thanks, laura

Ryan
I want to create an override for the jcemedia field plugin.
Instead of displaying the filename, I want to display a 'fixed' title, such as, click here for cv file.


You don't need to create an override.

In the parameters for the new field, set the Field Type to Files and type in your title in the Description field:

https://cdn.joomlacontenteditor.net/tmp/101632-create-override-for-jce-media-field-plugin-2.jpg

Is this what you had in mind?

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.