Component settings

Gallery3x4 min readPage 3 of 22
On this page 9

All settings are in System Settings, namespace gallery3x. Values you changed are kept when the package is updated.

General

KeyDefaultDescription
gallery3x.templatesemptyIDs of templates (comma-separated) that get the component tabs. Empty — no tabs anywhere.
gallery3x.source_id“Gallery3x Source” IDDefault media source. Set on installation.
gallery3x.source_mapemptyDifferent sources for different templates, one rule per line: 12:3 — template 12 to source 3; 15,16:4 — templates 15 and 16; *:2 — all other templates; 12:video:5 — only video covers of template 12 (types: image, video, attach, embed). Lines starting with # or // are comments. Empty — gallery3x.source_id everywhere.
gallery3x.ignore_template_sourceYesYes — ignore the “Media source” field of the template itself. No — the template source is used if there is no rule for it in gallery3x.source_map.
gallery3x.per_page30How many images per page on the manager tab.
gallery3x.new_file_positionendWhere new images go: end — to the end, start — to the beginning.
gallery3x.groups_per_userNoYes — each manager sees only their own images, videos and groups (created by them). No — everything is shared.
gallery3x.collections_thumb_sizesmallThumbnail size for the g3xCollectionsThumbnail snippet (a column in Collections).

Tabs

KeyDefaultDescription
gallery3x.video_enableNoThe “Video G3x” tab.
gallery3x.files_enableNoThe “Files G3x” tab (PDF, DOC, ZIP attachments, etc.).
gallery3x.embed_enableNoThe “Embed G3x” tab (maps, widgets, iframes).

Image processing

Thumbnail sizes are set not here but in the media source properties — see Thumbnail generation. The settings below apply to all thumbnails; the original is not changed. Regenerate thumbnails after changing them.

KeyDefaultDescription
gallery3x.driverimagickProcessing library: imagick (recommended) or gd.
gallery3x.formatwebpFormat of all thumbnails: webp, avif, jpg, png. Overrides fm in the source sizes. Empty — the original format.
gallery3x.filtersemptyGlide effects separated by |, for example greyscale, blur=5, sepia|bri=10|con=-5.
gallery3x.watermark_pathemptyWatermark file relative to the site root, for example assets/images/logo.png. Empty — no watermark.
gallery3x.watermark_positionbottom-righttop-left, top, top-right, left, center, right, bottom-left, bottom, bottom-right.
gallery3x.watermark_padding10Watermark offset from the edge, px.

Upload and file names

KeyDefaultDescription
gallery3x.upload_parallel1How many files to upload at once. On shared hosting — 1, on your own server 5–10 is fine.
gallery3x.upload_multipleNoYes — several files in one request (faster, but limited by PHP max_file_uploads). No — each file separately.
gallery3x.save_original_nameYesStore the original file name (without extension) in the “Title” field.
gallery3x.filename_translitYesTransliterate Cyrillic in file names: Фото.jpg → foto.jpg.
gallery3x.filename_sanitizeYesRemove everything except letters, digits, - and _ from the name; spaces become hyphens.
gallery3x.filename_lowercaseYesLower-case name and extension.
gallery3x.filename_as_hashNoThe file name is its MD5 hash. Takes precedence over the three settings above.

Matching names are not overwritten: a number is added to the new file. The maximum file size is limited by the MODX upload_maxsize setting and by PHP upload_max_filesize / post_max_size.

Image placeholders

See Image placeholders.

KeyDefaultDescription
gallery3x.set_placeholdersNoEnable the [[+g3x.N]] placeholders on site pages.
gallery3x.placeholders_tpl@INLINE <a href=…><img src=…></a>Chunk for [[+g3x.N]]. Empty — a data array is output instead of markup (for debugging).
gallery3x.placeholders_for_templatesemptyTemplate IDs where the placeholders work. Empty — all templates.
gallery3x.placeholders_thumbssmall,medium,bigWhich thumbnail sizes to expose in the placeholders.

Visual editor

KeyDefaultDescription
gallery3x.rte_enableNoThe “Insert from gallery” button in CKEditor / TinyMCE RTE.
gallery3x.rte_templatesemptyTemplates with the button: empty — same as gallery3x.templates, * — all.
gallery3x.rte_viewsemptyJSON with your own output views. See Inserting galleries in the visual editor.

Extra fields

Images, videos, files and embeds have the fields extra_text, extra_text2, extra_num, extra_date. Their labels in the edit window are set by gallery3x.<type>_label_extra_text etc., the tab name by gallery3x.<type>_label_tab_extra, where the type is image, video, attach, embed. Empty — the default label.

Other

KeyDefaultDescription
gallery3x.groups_processorGallery3x\Processors\GetGroupsCombinedProcessor class for the group list. See Custom groups processor.
gallery3x.kinescope_api_tokenemptyKinescope API token: title, description and cover of Kinescope videos. Without it the data is taken from the player page.
gallery3x.vk_app_idemptyVK API integration (vk_refresh_token, vk_device_id are filled in on authorisation). See VK.com API.

Permissions

Installation creates an access policy with the component permissions. A manager needs permissions to view and save resources, and for the gallery — gallery3x_view, gallery3x_save, gallery3x_remove (an administrator with full rights has them).

eqwjzsk4ojljdny8-screenshot-2