not working

Pessoal porque não esta funcionando o meu load css,

i want to change the css of the register. this is code that is in  register.php:

directory: /vendor/elgg/elgg/views/default/forms


{ elgg_register_css ( 'estiloCadastro.css' ,  elgg_get_simplecache_url ( 'estiloCadastro.css' ));

elgg_load_css('estiloCadastro.css'); } 

estiloCadastro.css is in the same directory.

I do not want to change via plugin to not change everything, but only the register.




  • The register view vendor/elgg/elgg/views/default/forms/register.php does not make use of any css that is only used on the register form. The form is created mainly by using the function elgg_view_field() to add the input fields and the css of these fields will be defined in css of Elgg site-wide.

    How to proceed depends on what you want to achieve actually. Do you want to change the look of the input fields (vendor/elgg/elgg/views/default/forms/register.php) or do you want to change the look of the whole register page (vendor/elgg/elgg/views/default/resources/account/register.php) or do you want to add some additional output to the register form?

    In any case the best way would require to create a (simple) plugin or to add the required/modified code to an existing plugin like your theme plugin and not modify Elgg core files (this would make any future site upgrades complicated as you would have to re-do any changes again and again).

    What you can do in a plugin is to override the register form and/or the register resource view (for changing the whole register page). You would start with copying the files vendor/elgg/elgg/views/default/forms/register.php and/or vendor/elgg/elgg/views/default/resources/account/register.php in your plugin at the locations mod/my_plugin/view/defaults/forms/register.php and mod/my_plugin/view/defaults/resources/account/register.php. Adding a start.php and manifest.xml additionally to your plugin you already have a working plugin. The two Elgg core views get overridden by your plugin (though you wouldn't see a difference yet if you haven't made modifications to these files in your plugin).

    What to do next depends on what you want to change. A css file added in your plugin (e.g. placed at mod/my_plugin/views/default/my_plugin/estiloCadastro.css) can be loaded by adding the line


    in the init function of your plugin in start.php. But to change the layout of either the register form or the register page you would have to modify the respective view in your plugin to make use of your css. And to not change the look elsewhere you would have to change the code in a suitable way (e.g. using the '#class' attribute of the elgg_view_field function to set the class defined in your css to be used for the input field or using the old way of coding the output directly in html code).

    If you only want to add some additional output to the register form you wouldn't have to necessarily overide the register form and/or register resource view. In the register form view is the line

    echo elgg_view('register/extend', $vars);

    This provides a way to add output to the form. You would just have to add the line

    elgg_extend_view('register/extend', 'my_plugin/register_form_extended');

    in the init function of your plugin and create a view at mod/my_plugin/views/default/my_plugin/register_form_extended.php. In this file you can add any additonal output that should be added on the register form below the input fields above the submit button.

    A solution without any coding is not possible unfortunately. But it's at least not really that complicated to make the changes (even if it might look this way from your perspective at the moment). Just give it a try.

  • I want to change the entire registry page, I did not quite understand how to change the whole page with your example could you give me a better example of how to change the entire registry page with plugin? Thanks.
  • Read iionly's reply again:

    You would start with copying the files


    in your plugin


    Now make the changes in these files of your plugin


    I copied the account / register file to my view folder of my plugin, what do I do after that?

  • I copied the two files as you said RvR how do I proceed to change?
  • Well, you can now edit the files you have copied and make the changes.

    As we don't know at all what you want to change on the register page we can't give you any more detailed help.