Best Website-BuildersBest Website-Builders
    What's Hot

    Sweden 0-3 Belgium: Zlatan Ibrahimovic breaks record as Romelu Lukaku scores hat-trick

    March 24, 2023

    Hailey Bieber thanked Selena Gomez for coming to her defense after receiving death threats following speculated feud

    March 24, 2023

    How to Make a Public Archive of Your Tweets

    March 24, 2023
    Facebook Twitter Instagram
    Facebook Twitter Instagram
    Best Website-BuildersBest Website-Builders
    • Home
    • CSS

      Federal agencies still use cell phones as tracking beacons

      March 24, 2023

      41 House Builders Score 5 Stars for Customer Satisfaction – Show House

      March 24, 2023

      CAS earns Chief Secretary or better in new review

      March 24, 2023

      Determining the survival benefit of postoperative radiation therapy in patients with pT1-3N1M0 rectal cancer who underwent total mesorectal resection: a retrospective analysis BMC Gastroenterology

      March 23, 2023

      What you need to know about CSS Profiles

      March 23, 2023
    • Joomla

      Save Thousands On Web Hosting With iBrave, Now Only $86

      March 23, 2023

      In Vitro Transcription Services Market Analysis, Research Study with Shanghai Zhishuo Biotechnology Co., Yunzhou Biotechnology Co.

      March 23, 2023

      Current state of UK content management systems

      March 23, 2023

      Reseller Hosting Business: Important Q&A

      March 21, 2023

      Web Hosting: 8 Elements Every Entrepreneur Should Look For

      March 20, 2023
    • PHP

      Hailey Bieber thanked Selena Gomez for coming to her defense after receiving death threats following speculated feud

      March 24, 2023

      ‘Vanderpump Rules’ star Raquel Levis intends to drop Shaana Shay’s restraining order

      March 24, 2023

      Beyoncé announces new fashion collaboration with Balmain

      March 24, 2023

      All shower trends on TikTok: 12 products to try

      March 24, 2023

      Why do I get gas and bloating on air travel?

      March 24, 2023
    • UX

      SMS pumping attacks and how to mitigate them

      March 24, 2023

      Q&A with Debbie Levitt on UX research and design — Visual Studio Magazine

      March 24, 2023

      New book examines effects of European arrivals in Mexico: UNM Newsroom

      March 24, 2023

      When and how to use HTML sitemaps for SEO and UX

      March 24, 2023

      What is an infographic resume? | | Career

      March 24, 2023
    • Web Builders
      1. Web Design
      2. View All

      What Comes First in Website Development — Design or Copy?

      February 2, 2023

      Modern Campus Honors Best Higher Education Websites of 2022

      February 2, 2023

      Premier SEO Consultant in Las Vegas, Nevada with Unparalleled Customer Service

      February 2, 2023

      Can Religious Freedom Be Saved? This group is racing the clock to teach America’s first freedom

      February 2, 2023

      How i Create New Google Account

      February 7, 2023

      CWT powers tools for meeting and event planners

      January 31, 2023

      Best Website Builder – Website Builders

      January 24, 2023

      Is There A Market For Rap-Themed Slot Games? – Rap Review

      January 19, 2023
    • WordPress

      Framework’s DIY laptop puts Apple and Microsoft to shame with upgradeable CPUs and makes me excited for the future

      March 24, 2023

      Insta360 hints at new challenger for DJI’s class-leading smartphone gimbal

      March 24, 2023

      New Python info-stealing malware uses Unicode to avoid detection

      March 24, 2023

      4 reasons Rescue is the remote support champion

      March 24, 2023

      Intel exits 5G and LTE PC business

      March 24, 2023
    • Realtoz
      • Our Other Sites
    • More News
    Best Website-BuildersBest Website-Builders
    Home » Add JavaScript or CSS tags to your Joomla headers! (per page – not site-wide).
    Joomla

    Add JavaScript or CSS tags to your Joomla headers! (per page – not site-wide).

    websitebuildersnowBy websitebuildersnowAugust 11, 2011No Comments2 Mins Read
    Facebook Twitter LinkedIn Telegram Pinterest Tumblr Reddit WhatsApp Email
    Share
    Facebook Twitter LinkedIn Pinterest Email


    First, you need a Jumi component or Sourcerer plugin for this to work. Since our main focus here is custom development outside of standard modules or articles within Joomla, we need one of these.

    Here you can find Jumi… my favorite extension for Joomla other than Breezing Forms.

    http://extensions.joomla.org/extensions/edition/custom-code-in-content/1023?qh=YToxOntpOjA7czo0OiJqdW1pIjt9

    ~My little ad for Jumi~

    *Jumi is a component that allows you to create custom php and js pages and load them into your Joomla site. So if you need to add AJAX or interactivity to your website, Jumi is the perfect component. Jumi is compatible with J1.0, J1.5 and J1.6. Jumi allows you to add custom content to modules, articles, and more.

    New to Jumi? You can find these helpful tutorials at http://edo.webmaster.am/jumi/tutorial.

    ~Now back to the main topic~

    If you’ve custom coded your page and need to add a bit of JavaScript or CSS to it, you’ll usually want to put those links in the template’s index.php page. , but now these scripts and css are applied site-wide and can mess up your template’s scripts and css on all pages. Is there a way I can add these scripts and css pages without manually adding them to the index.php page and not affect the site wide scripts and css.

    Plug this at the top of your customized php page and you will get the desired result only on the page where you add this code.

    <?php
                          $document =& JFactory::getDocument();
                          $document->addStyleSheet('files/css/default.css');
                          $document->addScript('files/scripts/test.js');
                          ?>
                          

    opens in new window

    This will add the script and css files to the tag for that particular page. You can then freely change that page without worrying about ruining your entire site.

    If you run into any issues, please refer to these two Joomla articles that provide further assistance.

    http://docs.joomla.org/Adding_JavaScript

    http://docs.joomla.org/Adding_JavaScript_and_CSS_to_the_page



    Source link

    Share this:

    • Tweet
    • Email
    • Pocket
    • Mastodon
    • WhatsApp
    • Telegram
    • Share on Tumblr
    • Print
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Telegram Email
    Previous ArticleWeb Development for Android Devices: Mobile Joomla!
    Next Article RapidSwitch supports the world’s first Joomla!™ dedicated server environment.
    websitebuildersnow
    • Website

    Related Posts

    Save Thousands On Web Hosting With iBrave, Now Only $86

    March 23, 2023

    In Vitro Transcription Services Market Analysis, Research Study with Shanghai Zhishuo Biotechnology Co., Yunzhou Biotechnology Co.

    March 23, 2023

    Current state of UK content management systems

    March 23, 2023
    Add A Comment

    Leave a Reply Cancel reply

    Top Posts

    Subscribe to Updates

    Get the latest sports news from SportsSite about soccer, football and tennis.

    Advertisement
    Demo

    This website provides information about CSS and other things. Keep Supporting Us With the Latest News and we Will Provide the Best Of Our To Makes You Updated All Around The World News. Keep Sporting US.

    Facebook Twitter Instagram Pinterest YouTube
    Top Insights

    Sweden 0-3 Belgium: Zlatan Ibrahimovic breaks record as Romelu Lukaku scores hat-trick

    March 24, 2023

    Hailey Bieber thanked Selena Gomez for coming to her defense after receiving death threats following speculated feud

    March 24, 2023

    How to Make a Public Archive of Your Tweets

    March 24, 2023
    Get Informed

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    © 2023 bestwebsite-builders. Designed by bestwebsite-builders.
    • Home
    • About us
    • Contact us
    • DMCA
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.