How to add js file in footer in drupal6? - drupal-6

i want to include one javascript file in the footer? I try like this, but its not including in the footer.
drupal_add_js(drupal_get_path('module','book') . '/js/visitsChart.js', array(
'scope' => 'footer'));
Please help me

It should be
drupal_add_js(drupal_get_path('module','book') . '/js/visitsChart.js','module','footer');

Related

Insert page break when using "markdown-pdf" nodejs module?

I'm using the node.js module "Markdown-PDF" (https://www.npmjs.com/package/markdown-pdf, version 9.0) to covert markdown to PDF, and I need to add a few page breaks to clean up the presentation in the PDF output.
I tried all the recommendations I could find on this and other forums, including inline HTML tags such as:
<div style="page-break-after: always;"></div>
And some CSS hacks, like applying page breaks to all div tags (as described here: http://forums.apricitysoftware.com/t/include-pdf-pagebreak-instructions-in-markdown/152). None of these are working, all tags in the markdown (source) document appear in the PDF (output) document un-rendered.
Expected (ideal) behavior would be to add the page breaks to the markdown files, and have the PDF reflect the desired changes. Something like this, within my markdown files:
markdown text
markdown text
markdown text
[page break command]
markdown text
markdown text
markdown text
Thanks in advance for any assistance or suggestions that anyone can provide!
Got an assist from a friend and figured this out. Markdown-pdf uses HTML5Boilerplate, so you can edit the index.html file, found here on my system:
/usr/local/lib/node_modules/markdown-pdf/html5bp/index.html
I added the CSS described here: http://forums.apricitysoftware.com/t/include-pdf-pagebreak-instructions-in-markdown/152
And it worked. Was able to include the HTML tags described in the post and force page breaks. Success!
The styled div tag you mentioned only works if the html parameter of remarkable object is set to true in options parameter:
var markdownpdf = require("markdown-pdf")
, fs = require("fs")
let options = {
paperFormat: "A4",
paperOrientation: "landscape",
remarkable: {
html: true
}
}
fs.createReadStream("teste.md")
.pipe( markdownpdf( options))
.pipe( fs.createWriteStream("document.pdf"))
In order to use a md marker (instead of using html div tag), I guess you should use preProcessMd and change a specific pattern to the styled div tag.
Hope I could offer some help!

Prestashop 1.7 include inline SVG in tpl file

I am trying to include an SVG inside my tpl file like this :
<?php echo file_get_contents("icon.svg"); ?>
Do you have some idea ?
Finally, I found a trick to include inline SVG file using the template system.
So I just create a folder named _svg in the templates folder of the theme. I renamed my icon.svg file to icon.tpl and I included it using the following code:
{include file="_svg/icon.tpl"}
If you need a variable (for exemple in a loop, use :
{include file="_svg/icon-{$var.value}.tpl"}
If you have other ideas, do not hesitate to let me know !
See you!

load external html files with handlebars

I would like to create external Handlebars files using the following -
1. header- Contains html codes
2. footer- Contains html codes
3. nav- Contains html codes
4. search - Contains html codes
etc.
Is there a way with handlebars to do this, so that I can include each template if and when needed in a specific page. Not sure how to go about it.
Thanks!
Absolutely! You can use Handlebar partials to do this. Simply register your header, nav, etc files as partials and then you can use this in your main template by doing something like this:
{{> header }}
{{> nav activePage=(activePage) }}
Have you considered using ASP.NET?
If you wanted to add content from other html files, I would highly recommend using
#RenderPage()If you use this, then you could set up a layout such as:
#RenderPage("header.html")
Some random description
#RenderPage("navigationbar.html")
#RenderPage("searchbar.html")
- Insert some content here -
#RenderPage("footer.html")
I'm certain that if you use this kind of layout, you'd get the appearance you would want. Obviously this is just an example, so you'd probably want to add some kind of CSS layout to suit your taste, but this is how I would go about it in ASP.NET.

HTML: How to hide list of options in the script

I have 1000+ options (list of names) in html and JavaScript and would like to put them in one file which is not visible to anyone .. is it possible ? options will be updated (more options added) regularly and I would like to do it thru the file instead html and JavaScript.
use angular js that allow u to disable or enable any control in your partial page

how add jade in iframe?

I have this code in a file .jade :
iframe(src="file2.jade" width='100%' height='4000' frameborder=0 scrolling='no')
the file2 file is in the same folder as this file, but does not insert the file, what can I do?.
Thanks
Adding .jade file to an iframe does not make sense. Iframes are processed by a browser, and browser expects html, not jade.
So the answer depends on what are you trying to do, maybe include directive will help.
Add one more empty line above iframe tag code with the same space (or tab), . character is display for a space or tab I mention above.
article
..p Some text here (2 space after article block)
.. <--- An empty line with 2 space tab before iframe tag
..iframe(width='560', height='315', src='//www.youtube.com/embed/KpuDq9HyLeg', frameborder='0')
It's means have 1 more line above iframe tag with the same space (tab) and inside parent tag of iframe.
It's work for me. Hope this help!

Resources