Customizing system messages

How can to edit the system messages in Default theme for Elgg 1.8 How can to edit the system messages in Default theme for Elgg 1.8

Open the file

elgg\views\default\css\elements\layout.php

And change this CSS code

.elgg-system-messages {
position: fixed;
top: 24px;
right: 20px;
max-width: 500px;
z-index: 2000;
}
.elgg-system-messages li {
margin-top: 10px;
}
.elgg-system-messages li p {
margin: 0;
}

Open the file

elgg\views\default\css\elements\components.php

And change this CSS code

.elgg-message {
color: white;
font-weight: bold;
display: block;
padding: 3px 10px;
cursor: pointer;
opacity: 0.9;

-webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
-moz-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);

-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
}
.elgg-state-success {
background-color: black;
}
.elgg-state-error {
background-color: red;
}
.elgg-state-notice {
background-color: #4690D6;
}

 

Examples

For editing position from right to left and increase width for messages' field:

Open the file

elgg\views\default\css\elements\layout.php

And change this code

.elgg-system-messages {
position: fixed;
top: 24px;
right: 20px;
max-width: 500px;
z-index: 2000;
}

With this

.elgg-system-messages {
position: fixed;
top: 24px;
left: 20px;
max-width: 1000px;
z-index: 2000;
}

 

For editing messagess' font color and background color:

Open the file

elgg\views\default\css\elements\components.php

And change this code

.elgg-message {
color: white;
font-weight: bold;
display: block;
padding: 3px 10px;
cursor: pointer;
opacity: 0.9;

With this

.elgg-message {
color: red;
font-weight: bold;
display: block;
padding: 3px 10px;
cursor: pointer;
opacity: 0.9;

And change this code

.elgg-state-success {
background-color: black;
}
.elgg-state-error {
background-color: red;
}

With this

.elgg-state-success {
background-color: green;
}
.elgg-state-error {
background-color: white;
}

 

System messages in Default theme for Elgg 1.8

Share on Facebook
Share on Twitter




7 Responses to “Customizing system messages”

  1. pianist says:

    Next trick for amount of time to display the message (by default, 6 seconds)

    Ex., from 6 sec to 10 sec

    Open the file
    elgg\js\lib\elgglib.js
    And change this code
    delay = parseInt(delay || 6000, 10);
    if (isNaN(delay) || delay <= 0) {
    delay = 6000;
    }
    With this
    delay = parseInt(delay || 10000, 10);
    if (isNaN(delay) || delay <= 0) {
    delay = 10000;
    }

    Open the file
    elgg\js\lib\ui.js
    And change this code
    $('.elgg-system-messages li').animate({opacity: 0.9}, 6000);
    With this
    $('.elgg-system-messages li').animate({opacity: 0.9}, 10000);

    !Flush the cache after changes!
    :)

  2. Nudeler2 says:

    Thanks a lot!

  3. Edryc says:

    Admin,How do I display the number of friends, or the number of followers in the profile, such as :

    Friends (618)
    Followers (30)
    Groups (6) and etc ..

  4. Priya says:

    Hi pianist,

    I'm working with elgg 1.8. I want to show my error message with in the login form when i give wrong username or password. Is there any possible solution. Please let me know. It's very urgent.

    Thanks,

    • pianist says:

      Hi, Priya

      Open this file
      elgg\languages\en.php

      And change of the values for array:
      'LoginException:UsernameFailure' => 'We could not log you in. Please check your username/email and password.',
      'LoginException:PasswordFailure' => 'We could not log you in. Please check your username/email and password.',

  5. Priya says:

    Hi pianist,

    Thanks for ur reply. But it is not working. I need to show the error message after the username field when i give wrong username without reloading the page.
    Please reply me.

    Thanks,

Leave a Reply



Similar Elgg Hacks