I would like to add some script (<script>....</script>)before /html of index.
But there is no index.html only index.php in root.
Also in basic settings there is head and body.
But the script should be before /html of index.html
I would like to add some script (<script>....</script>)before /html of index. But there is no index.html only index.php in root. Also in basic settings there is head and body. But the script should be before /html of index.html |
I'm making a few assumptions here. Because you want to add some HTML, I'm assuming that you want it to appear somewhere. You can add HTML anywhere in a PHP script by using ?> HTML GOES HERE <? Please Don't do what I'm about to say! Right at the very top of Index.php you will see <?PHP Your HTML would go there, but! Dolphin doesn't work that way. Pages are rendered via templates so anything added to Index.php will probably crash the site rather than make it look better. You haven't told us what you plan to do with the HTML, thus the assumptions. However, be warned. Index.php is what they call a Core file and it shouldn't be tampered with under any circumstances. If you want something to appear on the home page, have a look at Admin/Builders/Pages Builder/Home Page. That's where you should start. |
Thank you for explaining each possibility. I mean, before the end tag </html> Actually, I would like to add some script related to 'service-worker.js' to implement 'add to home screen' user prompt.
I'm making a few assumptions here. Because you want to add some HTML, I'm assuming that you want it to appear somewhere. You can add HTML anywhere in a PHP script by using ?> HTML GOES HERE <? Please Don't do what I'm about to say! Right at the very top of Index.php you will see <?PHP Your HTML would go there, but! Dolphin doesn't work that way. Pages are rendered via templates so anything added to Index.php will probably crash the site rather than make it look better. You haven't told us what you plan to do with the HTML, thus the assumptions. However, be warned. Index.php is what they call a Core file and it shouldn't be tampered with under any circumstances. If you want something to appear on the home page, have a look at Admin/Builders/Pages Builder/Home Page. That's where you should start.
|
I mean, before the end tag
Actually, I would like to add some script related to 'service-worker.js' to implement 'add to home screen' user prompt.
Do these answers help? https://stackoverflow.com/questions/3556381/how-to-add-script-inside-a-php-code 7.3.5 with responsive UNI |
Have you tried adding a text or html block to your home page and entering the script in it? I've done some pretty amazing things there. Maybe you could also add it above or below the code for your splash screen. There are numerous possibilities. |
I haven't tried.splash screen section looks good idea.
Thank you Have you tried adding a text or html block to your home page and entering the script in it? I've done some pretty amazing things there. Maybe you could also add it above or below the code for your splash screen. There are numerous possibilities.
|
What you want to do is to look at the template files for your particular template.
Also, Modzzz (Deano would be mentioned but he stopped updating his modules) has a head injections module you can use. Geeks, making the world a better place |
I've never used injections. I've tried the ones in Admin with little or no enthusiasm. One stuck a word at the very top left of the screen and that wasn't too exciting. Modzzz Market page doesn't have any examples, nor does his recommended web site, other than the word TEST on the very top left. Maybe that's where I pinched the idea from. If you can do a screen shot with what you're trying to achieve, or even post the code here, we could have a fiddle in our spare time. In the meantime, have a look here: http://digital-junction.com/demo/ The horse splash is a free script I found on this forum. I've changed it to be more responsive. The text under it is a simple text box. While you're there, click on the member's pics below the horses. You'l be in for a very pleasant surprise. Click Member 1 first, read about him, then click on the other members in the links above. Watch the magic. I'm about to put both scripts up for grabs as soon as I get the test site finished. That will be soon.
|
If you need to add some javascript code to the header of a page, then you do that in the template files for your site; if a particular template file is not included, you copy if from the base template. The head injections in admin will add it for the entire site; if you need it on a particular page, then add it to the .html template file for that particular page. If you only need it for a page in one of the modules, say photos, then each module has it own template files; again, the module template will override the main template file. Geeks, making the world a better place |
I took a quick look at service worker and you're correct in saying that it has to go at the very beginning of everything. That shouldn't be hard to do, but have you researched whether the script will work with Dolphin or benefit it (or you) in any way? I eventually found some examples but they didn't seem to slot into Dolphin's design concept. In other words, placing the script where it belongs may not be of any benefit to you. Just a thought, but you could be chasing your tail unless you know where to go and what to do after the script is running. I'm not sure anything magic is likely to happen until you introduce more code elsewhere. That was something I couldn't figure out from the demos. |