Skip to content

Add width and height directives to Edit attachment iframe via front end #181

@secarica

Description

@secarica

Under some circumstances, specifically when using some old Joomla templates on Joomla version 5 or 6 (probably on 4 too), when editing an existing attachment via front end, the modal window displays very small horizontally (~25% by comparing to the browser window). This does not happen on native Cassiopeia template and nor when adding an attachment.

Solution: please add the width and height directives on the iframe displaying the edit dialog.

On version 4.2.1 just released this means line 466 on file /components/com_attachments/tmpl/attachments/default.php (in server installed instance; in .zip package I think this corresponds to /packages/attachments_component/site/tmpl/attachments/default.php)

Old existing line:
'body' => "<iframe src=\"$update_url\" scrolling=\"yes\" loading=\"lazy\"></iframe>",
should then become
'body' => "<iframe width=\"100%\" height=\"600\" src=\"$update_url\" scrolling=\"yes\" loading=\"lazy\"></iframe>",

I followed the values from Add attachment option (as opposed to Edit attachment), where the dialog was displayed correctly from the start anyway.

Than you,
Cristi

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions