Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8730415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:01:00+00:00 2026-06-13T09:01:00+00:00

I have an online Portfolio site that I transferred from a static HTML into

  • 0

I have an online Portfolio site that I transferred from a static HTML into Drupal 7 – trying to learn Drupal. I have 3 separate pages that have image galleries. I have a javascript (.js) file that adds reflections onto any image that carries a class=”reflect”. In HTML, this is easy to do, obviously, and it was working just fine in my static site. I would like to continue using it, but I cannot for the life of me figure out how to add the required class to my images.

Desired Result:

<img src="image.jpg" class="reflect" />
<img src="image2.jpg" class="reflect" />
<img src="image3.jpg" class="reflect" />

and so on…

Addressing other found suggestions:
All of my images currently do not carry a class at all.
I did find a couple of proposed work-around’s but they didn’t quite suit my needs as I need to add the same class to all of the tags present, while ignoring any elsewhere, such as the header and footer. Plus, while I know a little PHP, I’m not great at it. Drupal is supposed to be completely dynamic so I’m sure there’s a way to do this, but I’m at a loss.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T09:01:01+00:00Added an answer on June 13, 2026 at 9:01 am

    You can implement theme_image() to do that, in your template.php file just type the following:

    function [YOUR_THEME]_image($variables)
    {
        $attributes = $variables['attributes'];
        $attributes['src'] = file_create_url($variables['path']);
    
        $attributes['class'][] = 'reflect'; // add the class name here
    
        foreach (array('width', 'height', 'alt', 'title') as $key) {
    
            if (isset($variables[$key])) {
                $attributes[$key] = $variables[$key];
            }
        }
    
        return '<img' . drupal_attributes($attributes) . ' />';
    }
    

    Kindly note that this class will be added to all the images across the site.

    Hope this helps… Muhammad.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an online app that I am wanting to validate the HTML markup
I have an online ClickOnce application that launches from a web page. After the
I am trying to re-size uploaded images. From what I have found online, the
I recently uploaded my personal portfolio site online (www.edwardmanson.com) and have been attempting to
I have an online chat room that uses jQuery/Ajax for requesting data from the
We have online SharePoint site and we want to use tool or any way
I have looked online and i havent been able to fix a problem that
I have searched online for a solution, but have yet to find one that
I have an online portfolio created in Rails featuring different projects. I want to
I have online dating service. Premium user see a profile on site. profile is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.