Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
blazy
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
blazy
Commits
57f18d8d
Commit
57f18d8d
authored
1 year ago
by
Gaus Surahman
Committed by
Gaus Surahman
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3390513
by W01F, gausarts: Option to configure header for the caption title
parent
9f08631d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#24894
passed
1 year ago
Stage: build
Stage: validate
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
blazy.api.php
+4
-0
4 additions, 0 deletions
blazy.api.php
src/BlazyManager.php
+2
-1
2 additions, 1 deletion
src/BlazyManager.php
with
6 additions
and
1 deletion
blazy.api.php
+
4
−
0
View file @
57f18d8d
...
...
@@ -540,12 +540,16 @@ function hook_blazy_item_alter(array &$settings, array &$attributes, array &$ite
// $blazies->is('captioned') or $blazies->is('multimedia') in case
// captioned or not, or breaking multimedia or media player, etc.
// If any display issues with grid, media player, etc., refine or remove this.
// blazies.is[image|video_file|twitter, etc] is related to Media sources.
if
(
$blazies
->
get
(
'namespace'
)
==
'blazy'
&&
$blazies
->
is
(
'image'
))
{
$blazies
->
set
(
'is.figcaption'
,
TRUE
)
->
set
(
'item.wrapper_tag'
,
'figure'
)
->
set
(
'item.wrapper_attributes.class'
,
[
'blazy__content'
]);
}
// Changed default caption title tag from H2 to H3.
$blazies
->
set
(
'item.title_tag'
,
'h3'
);
// Since > 2.17-beta1, below is no longer needed, already merged.
// Modifies IMG attributes, relevant for BlazyFilter here, see
// https://www.drupal.org/project/blazy/issues/3374519:
...
...
This diff is collapsed.
Click to expand it.
src/BlazyManager.php
+
2
−
1
View file @
57f18d8d
...
...
@@ -194,12 +194,13 @@ class BlazyManager extends BlazyManagerBase implements BlazyManagerInterface, Tr
$keys
=
array_combine
(
$keys
,
$keys
);
$keys
=
array_filter
(
$keys
,
fn
(
$k
)
=>
strpos
(
$k
,
'title'
)
===
FALSE
,
ARRAY_FILTER_USE_KEY
);
$single
=
count
(
$keys
)
==
1
;
$ttag
=
$blazies
->
get
(
'item.title_tag'
,
'h2'
);
// Supports multiple description fields.
foreach
(
$captions
as
$key
=>
$caption
)
{
$css
=
$prefix
.
$key
;
if
(
strpos
(
$key
,
'title'
)
!==
FALSE
)
{
$inline
[
$key
]
=
$this
->
toHtml
(
$caption
,
'h2'
,
$prefix
.
'title'
);
$inline
[
$key
]
=
$this
->
toHtml
(
$caption
,
$ttag
,
$prefix
.
'title'
);
}
elseif
(
$key
==
'overlay'
)
{
$overlays
[
$key
]
=
$this
->
toHtml
(
$caption
,
'div'
,
$css
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment