Image in alert

I have a banner which appears when a user tries to do something wrong.  I want to add an image to this banner, all that I can get it to do is render an outline of an image (indicating the image is loading) and then the outline is replaced witht the word "image."  Any thoughts on this?  Thank you.

  • Are you indicating the right path to your image?

    Look into your html and see what the src for the image says.

  • This image path is correct.  I honestly believe it does not have enough time to load.  The banner is the standard one built into the Elgg framework  that is generated for all sorts of notifications.  Is there any way to extend how long the banner is displayed?

  • Look in the js files. 

    I would suggest using css as oppose to placing images directly into the message. 

    Try something like:

    $message = elgg_view_icon('myalert') . 'You are doing something wrong';

    system_message($message);

     

    Create a new css file and add:

    .elgg-icon-myalert, .elgg-icon-myalert:hover {

    background:transparent url('path/to/your/image') no-repeat;

    width:20px; // change as needed

    height:20px;

    }

     

  • This looks like it might work...where are the js files?  I would still like to see the code behind system_message() and register_error()   Thank you.

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking