gmazanakis Posted October 26, 2017 Share Posted October 26, 2017 Hello i would like to ask if there is a easy way to make my phone number in my website clickable from mobile devises (ios and android) Link to comment Share on other sites More sharing options...
abdus Posted October 26, 2017 Share Posted October 26, 2017 Turn them into links. Make sure to have no spaces in the phone number (inside href) <a href="tel:05345345345">Call Us!</a> To remove the spaces from a given phone number you can use: $spaced = ' 345 345 234 '; $clean = preg_replace('!\s+!', '', $spaced); $telUrl = "tel:$clean"; 3 1 Link to comment Share on other sites More sharing options...
Zeka Posted October 26, 2017 Share Posted October 26, 2017 In addition to Abdus: I usually use $sanitizer->digits($value) 1 1 Link to comment Share on other sites More sharing options...
gmazanakis Posted October 26, 2017 Author Share Posted October 26, 2017 sorry for my stupid questions but where i have to put this code (windows server) Link to comment Share on other sites More sharing options...
kongondo Posted October 26, 2017 Share Posted October 26, 2017 @gmazanakis, Is your site a ProcessWire website? 1 Link to comment Share on other sites More sharing options...
gmazanakis Posted October 26, 2017 Author Share Posted October 26, 2017 Thanks for the reply yes, but i did not write the code, but i want to improve my site. I have move it to a windows server if this is a matter. in which file i have to add the line's above? Link to comment Share on other sites More sharing options...
kongondo Posted October 26, 2017 Share Posted October 26, 2017 3 hours ago, gmazanakis said: in which file i have to add the line's above? Quick answer will be in a template file. I am assuming your next question will be, what is a template file? If I am not wrong, I would encourage you to first read up on ProcessWire, at least get to know the basics. As for a windows server, I have zero experience but IIRC, some people have had success running ProcessWire on such. Welcome to the forums. 1 Link to comment Share on other sites More sharing options...
gmazanakis Posted October 26, 2017 Author Share Posted October 26, 2017 An easy way is to find a ready module. to add to the processwire. This is the only thing that was to improve. but ok thanks Link to comment Share on other sites More sharing options...
kongondo Posted October 26, 2017 Share Posted October 26, 2017 28 minutes ago, gmazanakis said: An easy way is to find a ready module To the best of my knowledge, there is no module that will make phone numbers on your site clickable. We have a Phone Fieldtype, but I don't think that's what you want. 2 Link to comment Share on other sites More sharing options...
adrian Posted October 26, 2017 Share Posted October 26, 2017 47 minutes ago, kongondo said: To the best of my knowledge, there is no module that will make phone numbers on your site clickable. We have a Phone Fieldtype, but I don't think that's what you want. As @kongondo said that module, while being very useful if you want as easier way to manage entry and formatting of phone numbers and their component parts, it won't do what you want. Actually I am starting to think that what you are looking for is a way to format/convert phone numbers that are entered into a textarea/body field into clickable links, rather than having a dedicated phone number field. Is that correct? If so, then that could actually make a useful Textformatter module. Link to comment Share on other sites More sharing options...
gmazanakis Posted October 27, 2017 Author Share Posted October 27, 2017 this is the part of the code that we have set the phones number in the _init.php template $static_translations['telephone']['default'] = "Τηλ:<br>2821011111"; $static_translations['telephone']['english'] = "Phone:<br>00302821011111"; is it here that i have to put the code above ? Link to comment Share on other sites More sharing options...
gmazanakis Posted October 29, 2017 Author Share Posted October 29, 2017 Anyone please? Link to comment Share on other sites More sharing options...
teppo Posted October 29, 2017 Share Posted October 29, 2017 (edited) The main point here is that each ProcessWire site is unique. There's no 100% sure answer we can tell you without digging deeper into your codebase. That being said, you could try changing the lines you've posted here to something like this: $static_translations['telephone']['default'] = "Τηλ:<br><a href='tel:2821011111'>2821011111</a>"; $static_translations['telephone']['english'] = "Phone:<br><a href='tel:+302821011111'>00302821011111</a>"; Please be aware that this might not work as expected, and it might look awful if your site's stylesheet don't expect these numbers to be links. You should also test both versions afterwards to make sure that they actually work as expected – i.e. result in a call. Edited October 29, 2017 by teppo Fixed quotes :) 1 Link to comment Share on other sites More sharing options...
gmazanakis Posted October 29, 2017 Author Share Posted October 29, 2017 Thanks a lot for the reply. Unfortunately it does not work. There is some error to the code above and if I use it the site does not work appears “ Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Error has been logged. Link to comment Share on other sites More sharing options...
wbmnfktr Posted October 29, 2017 Share Posted October 29, 2017 $static_translations['telephone']['default'] = "Τηλ:<br><a href=\"tel:2821011111\">2821011111</a>"; $static_translations['telephone']['english'] = "Phone:<br><a href=\"tel:+302821011111\">00302821011111</a>"; OR $static_translations['telephone']['default'] = "Τηλ:<br><a href='tel:2821011111'>2821011111</a>"; $static_translations['telephone']['english'] = "Phone:<br><a href='tel:+302821011111'>00302821011111</a>"; 1 Link to comment Share on other sites More sharing options...
gmazanakis Posted October 29, 2017 Author Share Posted October 29, 2017 Thank you so so much. that’s work but I have two issues the first one I think is important a) after I make the change when I go to the site using a public WiFi appears (before the changes does not appears this messages): Web Page Blocked! You have tried to access a web page which is in violation of your internet usage policy. URL: http://www.mazanakishomes.gr/ Category: Newly Observed Domain Client IP: 192.168.120.4 Server IP: 185.4.133.172 User name: Group name: .... and at google chrome say the massage that the connection it is not private.... like my site it is not secure b) (minor importance) except from the main contact page I change also and the phone at the head.inc but from gry color the numbers become blue. Is it easy to keep the color gry Link to comment Share on other sites More sharing options...
cstevensjr Posted October 29, 2017 Share Posted October 29, 2017 Most likely Google is saying that your site doesn't have a Security Certificate from a known certificate issuer (i.e. the site doesn't use HTTPS). Lately they have been flagging sites for this. Link to comment Share on other sites More sharing options...
Christophe Posted October 29, 2017 Share Posted October 29, 2017 (edited) Hi, In site/external/style/style.css, just add: .template-phone a { color: #999; } between .contact-details li::before { ... } and /* --- social icons --- */ (currently line 2209). Edit: do you want to keep the color that is currently orange for the phone number on the contact page? Edited October 29, 2017 by Christophe Link to comment Share on other sites More sharing options...
gmazanakis Posted October 30, 2017 Author Share Posted October 30, 2017 thank you so much i am suprize that you know the line Yes i would like so Link to comment Share on other sites More sharing options...
Christophe Posted October 30, 2017 Share Posted October 30, 2017 Google Chrome/Chromium -> Ctrl+Shift+I (or Ctrl+Shift+J) -> Sources. (Or with another browser's developer tools.) Please see the attached image. [ Keyboard Shortcuts Reference: https://developers.google.com/web/tools/chrome-devtools/shortcuts ] Link to comment Share on other sites More sharing options...
Recommended Posts