Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3394 Lượt xem

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>

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 12 18
6259
0
thg 10 19
2160
0
thg 1 18
2538
1
thg 12 17
4926
1
thg 2 19
10719