Practical Solutions

Table of contents

  1. Scopes
  2. How to automatically create folder for a user and limit access?
  3. Override params via Profiles
  4. How to automatically create folders with the current date?
  5. Long file names and transliteration
  6. Image processing during the upload
  7. Use of high-quality photos with a free license
  8. Can I replace the run of a standard Media Manager (com_media)?

1. Scopes

One of the important part of Quantum Manager is Scopes. What is it mean?
Scope refers to the visibility of variables. In other words, which parts of your program can see or use it.

Using scopes you can create a navigation tree for quick access to the associated folders. It is typical to modern Operation Systems like macOS or Windows, so whenever the folder is located on the site, there is a way to create quick access to it by adding the scope.

Scopes in Quantum Manager
Scopes in Quantum Manager

Go to Options > Global Options tab and you will find scopes.

There are default scopes to be used according to its names:

Scope name Path to the folder
Images https://yourdomain.com/images
Documents https://yourdomain.com/docs
Music https://yourdomain.com/music
Video https://yourdomain.com/video


Quantum Manager - default scopes
Default scopes

You can set up a custom path to your folder. Note: the path comes from the site root, so you can access folders outside of /images/ folder. If no folder exists, the folder will be created as soon as you go to the component dashboard. It is possible to enable or disable default scopes according to your requirements.

1.1. How to separate/sort files of different formats? (media, documents)

Apart from pictures, there might be audio files, video, .zip archives and etc. on your site. The best way is to keep all these files separately.

The solution

Keep all non-graphic files by type outside of /images/ folder. We can configure several different options for uploading files into the 'right' folders, depending on the situation and file type. For instance, for documents you can use /media/docs/ path, for audio it might be /media/audio/, etc.

Default scopes in Quantum Manager
Default scopes in Quantum Manager

1.2. Creating custom scopes

Creating custom scopes gives you extra abilities.

Here is an example:

Creating custom scope in Quantum Manager
Creating custom scope in Quantum Manager
Creating custom scope in Quantum Manager
The result

You can create multiple custom scopes and use variables to get much precisely result.

Available varables:
Variable: Action:
{user_id} ID of current user
{year} current year
{month} curreny month
{day} current day
{hours} current hour
{minutes} minutes
{second} seconds
{unix} UNIX time in seconds

Example of use: images/{user_id}/{year}-{month}-{day}

Note: Do not forget to update robots.txt file, if new folders were created in site root using the scope.

2. How to automatically create folder for a user and limit access?

In some cases, you might want to automatize creating a new folder for the user of a specified user group and limit access within that folder only. It is actual if you are working on a portal or catalogue and need to set up permissions and give the users limited access to avoid managing images uploaded by other users. Such a scenario means every user will have access to the own folder only which is important for the website where various authors publishing the content.

2.1. Add scope with variable

To create such a scenario, let's use the default scope Images. Change the path to:

/images/user/{user_ID}

According to such logic, when a user accesses Quantum Manager, a new folder will be created if it yet not exists, and all such folders to be stored in /user/ folder. E.g. the user has ID 636, and the folder with the same name is created.

Update default scope with user variable in Quantum Manager
Update default scope with user variable

Now the user is limited in own folder:

The result
The result

By default, the Image scope creates a new folder according to user's ID.

2.2. Permissions

Now it's time to set up permissions to the specified user group to access. Let it be Manager User Group. By default, managers do not have access to the component, so let change the state in permissions.

Go to Components > Quantum Manager > Options > Permissions
Then click on Manager tab and set Access Administration Interface to Allowed.

Allow access to the Quantum Administration Interface for Managers
Allow access to the Quantum Administration Interface for Managers

More information on how to work with Joomla permissions in the official Access Control List Tutorial.

Now the user of Manager User Group can access Quantum Manager and work inside their own image folder only.

3. Override params via Profiles

One of the major component features is the ability to override settings for specified User Groups. In the previous example, we have modified the default scope Images, that change is global and works for users of all user groups and now it's time to make exceptions.

Using Profiles we can set up custom params and customize settings according to the architecture of the website.

Well, let's back to the previous example when we limited access to the user of Manager User Group. Now we will override params for Super Administrators using Profiles and JSON.

Go to Components > Quantum Manager > Options > Profiles and add a new override.

  • Select Super Administrators user group.
  • Add configuration name: scopescustom
  • Add the overrride:

{
    "scopescustom0": {
        "enable": "1",
        "id": "allfiles",
        "title": "All files",
        "path": "images"
    }
}

According to this JSON code:

  • We enable the override.
  • Set up override ID.
  • Set up custom title (All images instead of Images).
  • Change the path (images instead of images/user/{user_id}).

You can do the same for other user groups. Now when a Manager opens Quantum Manager, the access is limited to the custom folder and the scope has 'Images' name, but when Super Administrator opens the component, all /images/ folders are available and the scope name is 'All images'.

JSON format is used to override only scopes, in all other cases you need just to set up the configuration name and the override value. For example, we need the Super Administrator to Apply watermark by default and it should work as a button, but in case of Administrator we need to change the watermark position to top left.

Override params for different user groups via Profiles - Quantum Manager
Override params for different user groups via Profiles

All available variables are described in Profiles tutorial.

4. How to automatically create folders with the current date?

Ignoring the sorting of files leads to disorder and makes your work slower since the processing of a large number of files in the same folder requires additional time. The best way is to place images to the folders according to its dates. With Quantum Manager you can automatize this process and save a lot of time.

Let's change the first default scope according to our requirements and include variable to the path:

https://www.yourdomain.com/images/{year}-{month}-{day}

Add variables to create folder with date in name  - Quantum Manager
Add variables to create folder with date in name

According to such logic, a user of a specific user group (Editor, Author, etc.) will be redirected to the folder with the current date each time they open Quantum Manager. But now let's create a scope for administrators to see all images. We should add custom scope:

Name: All images

Path: https://www.yourdomain.com/images

All images scope - Quantum Manager
All images scope

And now we need to add an override in Profiles:

Give access to Adminisrators via configuration override  - Quantum Manager
Give access to Adminisrators via configuration override

Select a user group that should have access to All images scope (Administrator, Super Administrator).

  • User Group: Super Administrator
  • Config name: scopescustom
  • Override: none

The result is on the pictures below:

Access level for Administrator and Super Administrator  - Quantum Manager
Access level for Administrator and Super Administrator

The Administrators can see Images and additionally All images scope to access images root directory.

Access level for Editor, Author  - Quantum Manager
Access level for Editor, Author and Manager

This is what Managers and Authors see - only specific folders.

5. Long file names and transliteration

The widespread situation when you keep files with names which consist of a long name, Cyrillic, Greek or other alphabets, various symbols like space, comma and etc. As a result, you need time to rename file names to comply with the standards. The component removes extra characters and limit file names according to the max length param and converts symbols from uppercase to lowercase.

If you have had a file:
БОЛЬШОЙ праздник в городе!!# Октябрь=.jpg

After uploading, the file name will get the following name:
bolshoy-prazdnik-v-gorode-oktyabr.jpg

The transliteration table takes from the localization file of a language used in your Joomla back-end by default. You can set a maximum length of a filename via the parameter of the same name.

Go to Options > Global Options tab and you will find the required param.

5.1. Postfix

Adding postfix to filenames and maximum length of file name  - Quantum Manager
Adding postfix to filenames and maximum length of file name

The postfix mode allows you to add a hash to the file name to avoid uploading a file with the same name over the existing one. E.g. you have a file: picture.jpg. Soon you decided to upload another image that has the same name, but you want to keep the old file on your site. Enable postfix and when you upload picture.jpg file on your site and if the file with the same name already exists, a new picture_pxxxxxx.jpg (where x - there are numbers) file will be added.

6. Image processing during the upload

It often happens the situation when a user uploads photos directly from the camera. Such images have a big size and significantly slow down site performance.

Enable images auto resizing - Quantum Manager
Enable images auto resizing

Automatically image resizing - after enabling this param the image will be resized according to the width and height which you need to set up in settings.

But keep in mind that uploading big files and processing them require more resources. Therefore allocate more memory for scripts executing in .htaccess file and also specify a maximum upload file size.

6.1. How to configure?

For Apache server you can apply the following rules to .htaccess file:

php_value memory_limit 256M
php_value upload_max_filesize 50M
php_value post_max_size 50M

You can change these limits personally according to your requirements and server resource.

Additional tutorial: How to check PHP memory limit for Joomla

7. Use of high-quality photos with a free license

Some content creators can take the first illustration they found on the Internet and put it in the article. Usually, such an approach is wrong and can violate image copyright which can cause serious financial and reputation losses to the site owner. Finding the right image which is free-to-use and comply with your content takes a lot of time and is usually a kind of headache. How to save time and do not violate copyright law?

7.1. The solution

Use the photos from photo stocks providing high-quality photos with a free license. Quantum Manager comes with an in-built solution allowing the component to take images directly from photo stocks! There is an integration with Unsplash and Pixabay. You just need to click on the top right button 'Unsplash' or 'Pixabay' and type a search query in the field. The next step is choosing the most suitable image, set its size and save.

Pixabay API provides extra search options, so you can precise your search query with additional params:

Enable photostock services - Quantum Manager
Enable photostock services


Additional buttons are available - Quantum Manager
Unsplash and Pixabay buttons are available


Search images via Unsplash in Joomla
Search images via Unsplash


Search images via Pixabay in Joomla
Search images via Pixabay

8. Can I replace the run of a standard Media Manager?

Yes, it is possible. Go to Extensions > Plugins and find Quantum Manager Media plugin (quantummanagercommedia). Just enable it and now you are being redirected to Quantum Manager after opening core Media Manager (com_media) in Administrator Panel.