Skip to content

Commit

Permalink
add alt_text indexer
Browse files Browse the repository at this point in the history
  • Loading branch information
jackahl committed Oct 1, 2024
1 parent 6a4cce5 commit 9a8e282
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plone/app/contenttypes/indexers.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,8 @@ def getIcon(obj):
if obj.aq_base.image:
return True
return False


@indexer(IDexterityContent)
def getAltTag(obj):
return obj.alt_text
4 changes: 4 additions & 0 deletions plone/app/contenttypes/indexers.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,9 @@
factory=".indexers.mime_type"
name="mime_type"
/>
<adapter
factory=".indexers.getAltTag"
name="alt_text"
/>

</configure>

0 comments on commit 9a8e282

Please sign in to comment.