In a module's configuration file, I set the parameter as
<field
name="file"
type="media"
default="video.mp4"
directory="videos"
label="MOD_PLAYER_FIELD_FILE_LABEL"
description="MOD_PLAYER_FIELD_FILE_DESC"/>
Then I log in as the admin, open the module manager and that module. When I click on the select button beside the 'file' field, the media manager window loads but it can only see/select image files. How could make it be able to select video files?
Thanks!
By default this sadly doesn't work (at least in Joomla 2.5.*). In an older project we had to hack the com_media component for this to work. You need to apply the following change
diff --git a/administrator/components/com_media/models/list.php b/administrator/components/com_media/models/list.php
index b97a930..ebee3f4 100644
--- a/administrator/components/com_media/models/list.php
+++ b/administrator/components/com_media/models/list.php
## -156,7 +156,7 ## class MediaModelList extends JModel
default:
$tmp->icon_32 = "media/mime-icon-32/".$ext.".png";
$tmp->icon_16 = "media/mime-icon-16/".$ext.".png";
- $docs[] = $tmp;
+ $images[] = $tmp;
break;
}
}
Video and audio files will now show up using the "media" type, albeit with a broken image icon (as they have none). This patch could obviously be improved further by adding the necessary image information manually.
Related
I am trying to batch process .indd files created many years ago on old versions of InDesign.
I have 2 goals:
Open .indd files without having to manually click on the
dialogs:- "Update linked images? (select 'update')", "font errors
(select 'Skip')"
Save files to .indd, current versions native format, attaching _cc2020 to their original filename.
Here's how I am doing so far:
// Opening files
// specify source folder
path = '~/Desktop/source_dir';
// list files in the folder
var my_folder = new Folder(path);
list_of_files = my_folder.getFiles();
// open file(s)
fileObj = app.open(list_of_files);
// saving files
// get current documents
myDoc = app.activeDocument;
// save current document with specific name
myDoc.save(File('~/Desktop/test01.indd'));
I could not find ways to suppress (or provide preset default value to) the two dialogs.
Could someone please enlighten me how I can achieve this?
ps. I found providing false as second argument will suppress font dialogs, but "update images" dialogs still persists.
// open file(s)
fileObj = app.open(list_of_files, false);
resource I've been referring to https://wwwimages2.adobe.com/content/dam/acom/en/devnet/indesign/sdk/cs6/scripting/InDesign_ScriptingGuide_JS.pdf
Suppress dialogues with
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;
I have a legacy app that has five separate file uploads for a single DB record. Beside each file upload there is a field to enter a caption for the uploaded file.
I am considering replacing the whole lot with a fineUploader gallery and allow up to ten files to be uploaded.
However, it was useful on the old system to have a caption with each image for the ALT tag of the image when it comes to web display.
I could address this with multiple single file uploads using fineuploader and a caption field for each but I want to get away from having so many on the page.
I see there is an option to change the file name during upload so that might be an option but that could lead to very long/messy file names and may cause issues with accents and other characters.
Can anyone suggest a good approach?
I would suggest considering you use the built-in edit filename feature, as this seems most appropriate to me and will certainly be the simplest approach.
Another approach involves the following:
Add a file input field to your Fine Uploader template. This will hold the user-entered caption value. You will likely need some CSS as well to make this look appropriate for your project.
Initialize Fine Uploader with the autoUpload option set to false. This will allow your users to enter in captions and then upload the files by clicking a button (to be added later).
Register an onUpload callback handler. Here, you will read the value of the associated file's caption stored in the text input and tie it to the file with the setParams API method.
The file list portion of your template may look something like this:
<ul class="qq-upload-list-selector qq-upload-list" role="region" aria-live="polite" aria-relevant="additions removals">
<li>
...
<input class="caption">
</li>
</ul>
And your Fine Uploader code will contain this logic (important but unrelated options such as request.endpoint and element left out to maintain focus on your question):
var uploader = new qq.FineUploader({
autoUpload: false,
callbacks: {
onUpload: function(id) {
var fileContainer = this.getItemByFileId(id)
var captionInput = fileContainer.querySelector('.caption')
var captionText = captionInput.value
this.setParams({caption: captionText}, id)
}
}
})
Your server will receive a "caption" parameter with the associated value as part of each file's upload request.
I have an existing file upload (manual) in my web application. My application already shows existing uploaded files and a way to delete files.
I would like to incorporate the dropzone.js drag and drop into a small target area - but that is all. I don't want dropzone to print/render anything back to the screen - no messages, no images, nothing.
Could someone provide and example of how to configure dropzone for this limited functionality?
You can accomplish this by modifying the stylesheet. For example, setting
.dz-details
{
display:none;
}
will remove the box which shows what was uploaded. By modifying more styles, you should be able to remove the other elements that normally appear.
You can do that on init:
const dropzoneConfig = {
addedfile: file => { console.log(file); }
}
const myDropzone = new Dropzone(myDiv, dropzoneConfig)
I'm running JomSocial 3.2 on Joomla 3.
I want to add some content to the right side of the registration page.
Some pictures and other contents.
So far, i've been able to get to the "register.index.php" file,
which is the file that displays some of the content in the homepag.
The file is in: "/site_root/components/com_community/templates/default/" folder
but i've not been able to fully edit the whole registration page.
This could be done in many different ways - even without editing any file. Install this extension: http://extensions.joomla.org/extension/advanced-module-manager and when editing module you'll have additional tab called "tasks" There will be field URL, type inside URLs of your registration form. Thanks to this you'll be able to assign modules to registration form.
You could also override for:
ROOT/components/com_community/templates/default/register.index.php
Copy it to:
ROOT/templates/your-template/html/com_community (if you don't have "html" or "com_community" folders, feel free to create them)
Then you may create module position inside file using this code:
$modules = JModuleHelper::getModules( 'reg-positon' );
foreach ($modules as $module) {
$_options = array( 'style' => 'xhtml' );
echo JModuleHelper::renderModule( $module, $_options );
}
Above code creates module position: "reg-positon'. You'll need to type this name manually as it will be not listed on module positions list.
Now you'll need a bit of html to display it on right or left of registration form.
I have a working TYPO3 extension. It is attached this wiki page. How can I change the code of this extension so it is of the USER_INT type? I.e. I don't want TYPO3 to cache the output of this plugin, and want TYPO3 to invoke the extension ever time a page that uses the extension, i.e. disable the caching for this extension.
To disable caching for your extension go to your piX/class.tx_XXX_piX.php file and remove the following line (below your class declaration):
var $pi_checkCHash = true;
You also need to add the following line in the main method (below $this->pi_loadLL();):
$this->pi_USER_INT_obj=1; // Configuring so caching is not expected. This value means that no cHash params are ever set. We do this, because it's a USER_INT object!
grunwalski it's the opposite you have to change this:
t3lib_extMgm::addPItoST43($_EXTKEY,'piX/class.tx_yourextension_piX.php','_piX','list_type',1);
to this:
t3lib_extMgm::addPItoST43($_EXTKEY,'piX/class.tx_yourextension_piX.php','_piX','list_type',0);
The simpliest way to solve your problem is to go back to Extension Maganer, select your extension, choose "Edit in Kickstarter" from the dropdown menu, and then select the corresponding Frontend plugin to edit it's properties.
Check the first checkbox which means that you want your plugins to be rendered as USER_INT cObjects. After that click the View result button, uncheck all custom PHP files (your own code, like modules and plugins) on the right side and click the WRITE button. Please be careful. If you don't uncheck the checkboxes of your own files, they will be overwritten with dummy files.
The correct and comlete way to do this is a combination of the answers of #arturh and #Mehdi Guermazi:
change the last parameter in the addPItoST43() call in ext_localconf.php from 1 to 0
remove the var $pi_checkCHash = true; line from the property definitions in the head of the pi1 class.
add the $this->pi_USER_INT_obj=1; line to the start of the main() function in pi1.
These changes are identical to what you will get when you use the kickstarter method explained in the solution of #bencuss.
When you have created your extension with Kickstarter you also have to go to the file [yourextension]/ext_localconf.php and change this line
t3lib_extMgm::addPItoST43($_EXTKEY,'piX/class.tx_yourextension_piX.php','_piX','list_type',0);
to this:
t3lib_extMgm::addPItoST43($_EXTKEY,'piX/class.tx_yourextension_piX.php','_piX','list_type',1);
Edit the file setup.txt of your extension "myext". Change "USER" into "USER_INT".
plugin.tx_myext = USER_INT
plugin.tx_myxt {
This extension will never be cached.