跳至內容
選單
此問題已被標幟
3284 瀏覽次數

Hello guys,

i'm stuck with this problem.
I had 2 different modules that make different thinks and all two need the tag for Safari iOS WebApp for adding web page as native APP:

<link rel="apple-touch-icon" href="ic_launcher-web.png"/>
<meta
name="apple-mobile-web-app-title" content="Title"/>
<meta
name="apple-mobile-web-app-capable" content="yes"/>

But the problem is that all two gets loaded because i inherit web.assets_frontend and add them into it that will add them into <head>.

It's possible to load dynamically the assets or css and js resources?
Something like.. load this templates when the relative template of web pages gets rendered by controller?

Only add this to <head> when template 1 is rendered

<template id="for_app_1">    
    <link rel="apple-touch-icon" href="ic_launcher-web1.png"/>    
    <meta name="apple-mobile-web-app-title" content="Title 1"/>    
    <meta name="apple-mobile-web-app-capable" content="yes"/>
</template>

Only add this to <head> when template 2 is rendered
<template id="for_app_2">    
    <link rel="apple-touch-icon" href="ic_launcher-web2.png"/>  
    <meta name="apple-mobile-web-app-title" content="Title 2"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
</template>

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
12月 18
6154
0
10月 19
2090
0
1月 18
2510
1
12月 17
4781
1
2月 19
10597