-
AuthorPosts
-
January 17, 2021 at 2:16 pm #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/testhow can i deaktivate this automatic transformation :D
Thanks
January 17, 2021 at 6:43 pm #1273128Hey beste_medien_werbe_agentur,
It does not work like that. Do you need to give users an option to download a file?
Best regards,
VictoriaJanuary 18, 2021 at 2:28 pm #1273333Hi 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)
January 18, 2021 at 7:57 pm #1273439Hi 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,
VictoriaJanuary 19, 2021 at 2:21 pm #1273714Hi 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
January 20, 2021 at 5:49 pm #1274133Hi beste_medien_werbe_agentur,
You should never give anyone access to your c:\ disk, does not matter the OS.
Best regards,
VictoriaJanuary 20, 2021 at 6:36 pm #1274153Victoria,
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” and not only “Test”.hopefully now is clear :)
January 24, 2021 at 11:33 pm #1275132Hi,
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 offile:///x:/xxx/..
, or even a blanktest
in the image Link Settings, I imagine you are trying to usemobilepay://
ormagnet:
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,
MikeJanuary 27, 2021 at 10:46 am #1275710Hi 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.”
<- YESa) 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!
January 27, 2021 at 12:11 pm #1275749put 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?
January 27, 2021 at 12:21 pm #1275755January 27, 2021 at 5:14 pm #1275833Thanks Mike! Example below
January 29, 2021 at 12:34 pm #1276279Hi,
Thank you for the feedback, I found a function to allowfile:///
, 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,
MikeJanuary 29, 2021 at 3:40 pm #1276328Hi Mike!
Awesome your effort.
i tryed, I put your Code in functions.php (childtheme). But something is not working.
i create simple:
file:///C:/
Linkbut they dont work.
can you try: open a Link in wordpress with enfold: “file:///C:/” ?
Thanks and thanks! :–)
- This reply was modified 3 years, 9 months ago by beste_medien_werbe_agentur.
January 30, 2021 at 10:57 am #1276496ok, 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
January 30, 2021 at 12:17 pm #1276500Hi,
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 -
AuthorPosts
- The topic ‘Image Link Settings – Automaticly file:///x:/xxx/.. to domain.tld/xxx/’ is closed to new replies.