• Resolved pupeno

    (@pupeno)


    On the documentation for this plug in I found:

    When writing Javascript and CSS Templates it would be considered like writing separated .js or .css files, no <script> or <style> or <link> tags should be added in those templates. Those Tags are being added automatically by CJT Templates linker. Adding those tag would break those Templates.

    Embedding Template is current will embedded Javascript and CSS templates without any tags appended. Its still a good practice to follow the Above strategy of avoiding adding any Tags as next CJT release would start adding those templates while embedding too.

    I created a couple of javascript blocks and they are being output as is, without the <script> tag. Adding the tags is discouraged but it seems to be the only way to make it work, or am I missing something?

    https://wordpress.org/plugins/css-javascript-toolbox/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author wipeoutmedia

    (@wipeoutmedia)

    Hi Pupeno,

    Thanks for your support message.
    When you add Code Files (by clicking Master near the title of a Code Block), you DO NOT need to use <script> or <style> as CJT automatically wraps it for you. I believe this is also the case with Code Templates – I need to refresh myself here, so feel free to double-check and post your results. 🙂

    If you only use the standard Code Blocks without saving the block as Code Files, then you would need to wrap the CSS and JavaScript code as in:

    <style type=”text/css”>
    … your CSS code here
    </style>

    <script type=”text/javascript”>
    … your JavaScript code here
    </script>

    Regards,
    Damian

    Hello,

    Simply, if you’re want to embedded (copy and past template code into code block) template into a code block you then need to use <script> and <style> tags for JS and CSS types respectively. However you need to write those tags only if you’re using “HTML” and “PHP” code files.

    The code inside every Code block is a “CODE FILE”. Code file has type. You can change code file TYPE by clicking on “master” (right to the Block name). CJT would automatically add <script>, <style> and even <?php ?> tags for Javascript, CSS and PHP types respectively.

    hope this helps.

    Regards,
    AHMeD

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding and tags’ is closed to new replies.