Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

There is a requirement in my website: The post content should have a link (it is for IOS device to install apps) like the following.

<a href="itms-services://?action=download-manifest&url=http://www.mywebsitname.com/appdown/CESBGM.plist" class="STYLE17">Install APP</a>

I used the Ckeditor and it can make it.

Is there any other ways to make it? I tried the Link module, but it failed.

share|improve this question

1 Answer 1

Drupal has a function called filter_xss_bad_protocol that strips unknown protocols from links created with the l() function - This is a very smart idea but makes it difficult when you want to include emerging link protocols like skype:// for example. Dave Reid has created a fantastic module that works around this and allows developers to add their own protocols to the list.

http://drupal.org/project/filter_protocols

With that module installed, and your specific protocol added to its configuration screen, it would then be possible to do something like this in your code:

<?php print l("Displayed Text", "itms-services://?action=download-manifest"?>

Additionally, use the attributes and query parameters of the l() function to pass your url parameter to the link. See this for an example... http://api.drupal.org/api/drupal/includes%21common.inc/function/l/7 - You'll find the particular comment regarding passing parameters on that page here: http://api.drupal.org/comment/38198#comment-38198

Hope that helps! Good luck.

P.S. To clarify, simply adding the above module and configuring it will also allow the Link module to respect the protocol since it passes everything through l() - So no code required. :) Merely for completeness.

share|improve this answer
    
,Thank you for your replay. I have been google it for a long time. I try to use the filter_protocols module,and try to add the itms-services protocol but get the message:Invalid protocol itms-services. The protocol cannot be added. what should i do know now ? –  googlg Feb 28 '13 at 1:39
    
I have no idea what to do? –  googlg Feb 28 '13 at 5:51
    
God bless me,to solve it –  googlg Feb 28 '13 at 9:41
    
Can you please be more specific in how you are adding it? What exactly are you typing into the field? –  webkenny Mar 1 '13 at 17:56
    
thank you @webkenny,i have solved it. –  googlg Mar 4 '13 at 0:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.