Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'd like to modify insert-link.tpl.php but it seems it is never picking it up from my theme templates directory. Note it's a zen subtheme.
Comments
Comment #1
tahiticlic CreditAttribution: tahiticlic commentedSame behavior here. I'm using a custom theme, no Zen interaction.
Comment #2
quicksketchIt's probably because you're using an admin-theme for creating content. You may need to subtheme your admin theme (Seven, most likely) and place the template in your subthemed admin theme.
Comment #3
tahiticlic CreditAttribution: tahiticlic commentedSame behavior even when inserting custom templates in the admin theme.
Comment #4
tahiticlic CreditAttribution: tahiticlic commentedAlso tried without an admin theme, same bahavior : no way to override default template files.
Comment #5
tahiticlic CreditAttribution: tahiticlic commentedLatest test : replacing insert module templates directly in the module, no effect...
Comment #6
quicksketchMaybe you're editing the wrong template file? Clearly the markup has to come from *somewhere*, and the template files are where the markup originates. Note that there are two template files for images: "image-insert-image.tpl.php", which is used for inserting images that have an image style (like thumbnail, medium, larget, etc) and "insert-image.tpl.php", which is used when inserting a full-size image.
Comment #7
tahiticlic CreditAttribution: tahiticlic commentedYou right, I guess I'm not editing the good file. I'll check that.
Comment #8
kliker CreditAttribution: kliker commentedBasically in order to override module's templates you need to upload them to your admin theme folder.
Module's README.txt is saying to your active theme's directory and I believe it would be easier to understand by saying to your admin theme directory.
Comment #9
quicksketchThanks @kliker, good suggestion. I'm moving this to a task.
Comment #10
cac2s CreditAttribution: cac2s commentedHello guys.
First of all I apologize for my English and I hope you will understand me right...
I ran into the same problem.
I need to wrap img tag with div tag like this:
I have copied the image-insert-image.tpl.php file in the folder with the active theme (editing node is not in the admin theme, but in the active theme), then I have edited template with code above, cleared the cache, but when I insert a thumbnail picture there is no changes:
P.S.: I have tried do same chanes with insert-image.tpl.php — no result.
P.S.S.: сopying the template file to the folder with admin theme (ROOT_FOLDER/themes/seven/) also gave no results.
UPD: customizing template colorbox-insert-image.tpl.php solve my problem.
Comment #12
Snater CreditAttribution: Snater commentedBrowsing through old tickets while working on the module's D8 version. I altered the Readme file as suggested. The place where to put template overwrites is a regular source of confusion, so, for some emphasis, I put ADMIN in capital letters.