Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #1273051

    Hi,

    i want to link a Netwerk/lokal folder or File .
    so it works well “file:///x:/xxx/..”

    BUT: when i try it, to put in “image Link Settings” .. Save..
    it change the Link “file:///x:/xxx/..” to ” domain.tdl/xxx”

    i tried:
    “file:///x:/xxx/..”
    http://file:///x:/xxx/.. <- works, but actally no :D. because i get an error ;)
    with and without “: x:/xxx
    test -> yeah.. -> domain.tdl/test

    how can i deaktivate this automatic transformation :D

    Thanks

    #1273128

    Hey beste_medien_werbe_agentur,

    It does not work like that. Do you need to give users an option to download a file?

    Best regards,
    Victoria

    #1273333

    Hi Victoria,

    i want to show the lokal folder, example:
    C:\
    Wenn i put “C:\” in chrome and press ENTER i see folder and files.
    *** in windows with chrome *** and no need mac/linux.

    so i want “on klick” -> target_blank (new Tab)-> C:\ (see files and folder)

    #1273439

    Hi beste_medien_werbe_agentur,

    This is a security risk and this is not how it’s done. If you want to allow your users access to some directory on your server you can do that but it’s not a theme function and so we cannot help you with that. I would recommend you hire a freelancer to help you with the solution.

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #1273714

    Hi Victoria,

    no i dont want that users have acces to my server.

    i think you use MacOS or Linux? Could someone check my thread with windows? :D

    Other words:
    When you use Chrome and type in the adressbar C:\ and press Enter. On your lokal windows machine.
    What did you see? Yes exactly.
    now i want create a button/link that: open a new tap (target_blank) and Type C:\ and press Enter :D. Thats all.

    Thanks

    #1274133

    Hi beste_medien_werbe_agentur,

    You should never give anyone access to your c:\ disk, does not matter the OS.

    Best regards,
    Victoria

    #1274153

    Victoria,

    YES it was an example.

    okay other words:

    ENFOLD: “image Link Settings” , when i put “test” and not a hyperlink.
    ENFOLD translated automaticly domain.tld/test.
    On the live site, when i hover over the Button i got “https://domain.tld/test&#8221; and not only “Test”.

    hopefully now is clear :)

    #1275132

    Hi,
    Sorry for the late reply, as I understand your situation you want to use a different prefix in the image Link Settings, the theme automatically adds the domain and changes unknown prefixes to HTTP.
    While I’m not certain of your exact planned use of file:///x:/xxx/.., or even a blank test in the image Link Settings, I imagine you are trying to use mobilepay:// or magnet: or something similar, either way I believe that I can help with a script like this:

    //example only  
    (function($) {
      $(".example").each(function() {
        var link = $(this).attr('href');
        $(this).attr('href', 'mobilepay:' + link);
      });  
    })(jQuery);

    But I will need a bit more info, please link to your page with an exact use and explain what you want the link to point to, and how often this will occur, such as on one page only, or in one section only in every post, etc. The goal is to identify an exact class used and the situation, such as which pages, posts, etc. You would not want this running wild on your site.

    Best regards,
    Mike

    #1275710

    Hi Mike,

    “as I understand your situation you want to use a different prefix in the image Link Settings, the theme automatically adds the domain and changes unknown prefixes to HTTP.”
    <- YES

    a) Private Content i show you a short video, what i want.
    b) Private Video is showing with an Button, but yes, i want in some Sections (Mansiongallery) this funktion, but if it is to complex, i can do it with buttons :)
    c) i tryed your script (put it in function.php, but got some errors, so dont know if its working :>)

    Thank you Mike!

    #1275749

    put in functions.php ? child or parent?

    If parent – where did you insert that snippet?

    Next: if i test this input: file:///x:/xxx/ in the advanced tab of image alb – link settings: manually
    it does not change to domain.tld/xxx ?

    so what is the link you would like to have? and that works if you put it in the url window of your browser?

    #1275755

    Hi,
    Thank you for the video, please see below.

    Best regards,
    Mike

    #1275833

    Thanks Mike! Example below

    #1276279

    Hi,
    Thank you for the feedback, I found a function to allow file:/// , I tested it on my localhost with a text link and it was showing on the front end.
    I also found that you need five slashes at the front. The protocol is “file:///” … with three(not two)slashes. The next two slashes are the beginning of the UNC path.
    Try adding this code to the end of your functions.php file in Appearance > Editor:

    function rh_allow_file_protocol( $protocols ) {
        $protocols[] = 'file';
        return $protocols;
    }
    
    add_filter( 'kses_allowed_protocols', 'rh_allow_file_protocol' );

    Best regards,
    Mike

    #1276328

    Hi Mike!

    Awesome your effort.

    i tryed, I put your Code in functions.php (childtheme). But something is not working.

    i create simple:
    file:///C:/
    Link

    but they dont work.

    can you try: open a Link in wordpress with enfold: “file:///C:/” ?

    Thanks and thanks! :–)

    #1276496

    ok, i researched too. And Mike… THANK YOU :)

    Problem solved:
    For e. G. Chrome i a Plugin https://chrome.google.com/webstore/detail/enable-local-file-links/nikfmfgobenbhmocjaaboihbeocackld/ what allows “to click” on File:///c:/ – after that -> works like it should :).

    And with your Code in function.php:
    ———–
    function rh_allow_file_protocol( $protocols ) {
    $protocols[] = ‘file’;
    return $protocols;
    }

    add_filter( ‘kses_allowed_protocols’, ‘rh_allow_file_protocol’ );
    ————
    Everything works now.

    T H A N K Y O U

    #1276500

    Hi,
    Glad we were able to help, we will close this now. Thank you for using Enfold.

    For your information, you can take a look at Enfold documentation here
    For any other questions or issues, feel free to start new threads in the Enfold forum and we will gladly try to help you :)

    Best regards,
    Mike

Viewing 16 posts - 1 through 16 (of 16 total)
  • The topic ‘Image Link Settings – Automaticly file:///x:/xxx/.. to domain.tld/xxx/’ is closed to new replies.