2
クリックしたときにPDFファイルが表示されるリンクがあります。ラップトップから見るとリンクが動作しますが、モバイルデバイス(iPhone6、galaxy s6、huawei p9を試しました)リンクは何もしません。私はそれをクリックすることができますが、それについてはそれです。モバイル用のリンクがクリックできない
<a href="http://localhost/mlndemo/sites/default/files/2017-02/voorbeeld_sollicitatiebrief_0.pdf" type="application/pdf; length=420819" title="voorbeeld_sollicitatiebrief.pdf">Bekijk hier de volledige vacature</a>
誰か助け
EDITを事前に感謝し、これは素晴らしい:)になり、モバイルデバイス上で動作していない理由で私を助けることができる場合: は上でこのコードを発見drupalサイトはtarget_blankを作成します。これは、新しいウィンドウでファイルを開くように動作するようです。誰かがそれを必要とするかもしれないので、ここにコードを掲載します。 これは、Drupal(8)の場合にのみ有効です。THEMEをあなたの名前に変更してください。
/**
* Implements hook_preprocess_HOOK().
*/
function THEME_preprocess_file_link(&$variables) {
// Add target _blank attribute to all file links.
$file = $variables['file'];
$url = file_create_url($file->uri->value);
// Use the description as the link text if available.
if (empty($variables['description'])) {
$link_text = $file->filename->value;
}
else {
$link_text = $variables['description']->__toString();
}
$link = '<a href="'.$url.'" type="'.$file->filemime->value . '" length="' . $file->filesize->value . '" title="' . \Drupal\Component\Utility\Html::escape($file->filename->value) . '" target="_blank">' . \Drupal\Component\Utility\Html::escape($link_text) . '</a>';
$variables['link']->setGeneratedLink($link);
}
PDFのサポートが組み込まれていない可能性があります – mplungjan
http://stackoverflow.com/questions/18564774/how-to-support-pdf-viewing-for-all-mobile-browser – mplungjan
ありがとう、それをチェックしてください! – Blomkfist174