Replace Elgg File url

How to replace default url for Elgg File When you uploading files on the Elgg site, it is automatically created the view url:

How to replace default url for Elgg File

For changing view url on download  link

 

Open the file

elgg\mod\file\start.php

And edit this code

return "file/view/" . $entity->getGUID() . "/" . $title;

With this

return "file/download/" . $entity->getGUID();

Replace default url for Elgg File

Share on Facebook
Share on Twitter




12 Responses to “Replace Elgg File url”

  1. David says:

    can I replace site.com/profile/username to site.com/username ?

  2. unRar says:

    Sorry, not quite on the topic. Just wanted to ask if "Register" option can be removed from the login page?
    Reason being, is that I am building invitation only network and allowing only invites from existing members – users will be receiving a link and registering through there.

    Thank you for taking your time on this!

    Best Regards

    • piainist says:

      In first, you can to deactivate User registration setting in Administration -> Settings : Advanced Settings

      Another way, removing Register form from your site:
      In this file
      elgg\views\default\forms\login.php
      Delete this code
      <ul class="elgg-menu elgg-menu-general mtm">
      <?php
      if (elgg_get_config('allow_registration')) {
      echo '<li><a class="registration_link" href="' . elgg_get_site_url() . 'register">' . elgg_echo('register') . '</a></li>';
      }
      ?>
      <li><a class="forgot_link" href="<?php echo elgg_get_site_url(); ?>forgotpassword">
      <?php echo elgg_echo('user:password:lost'); ?>
      </a></li>
      </ul>

      • unRar says:

        Cheers! Thank you very much!
        I disabled user registration, however that impedes with invitation registration..:(

        Thank you for taking your time on this one!!!

        Best Regards!

  3. unRar says:

    Just as update, editing login.php worked perfectly. Thank you once again for this!!

Leave a Reply



Similar Elgg Hacks