Skip to content
General Revolution Evolution Add-ons International
Login | Register | MODX.com
MODX Open Source Content Management System, Framework, Platform and More.
Find a Partner | Hosts + SaaS | Jobs | Donate
  • RegisterSign Up with the MODX Community
  • LoginUse Your MODX.com Account
  • MODX Community Forums
  • Add-ons
  • Manager, Parser & the Core
  • PHx
  •  
  • Can i use PHx to include javascript files on specific pages?#

  • 36549
    337
    www.9thwave.co.uk
       WEB | DESIGN | PRINT

    9thwave Reply #1, 1 year, 5 months ago

    Reply
    • Link to this post#1
    Hi,

    I've never used PHx but i think i understand the concept although have yet to put it into practice.
    My situation is that i have a couple of particular pages using specific javascript files and rather than adding links to all the javascript files in my {{head}} chunk i wondered if there was a way to do the following...
    - Include JS files if page ID is equal to #3

    Is this possible using a PHx if statement?
    If i can do it this way it would mean i can limit the amount of templates i use which i like to keep to a minimum.

    Thanks for any help

    J


  • 4172
    1,614
    xdbedit - create your own CMP to edit custom-tables with TV-input-types
    MIGX (multiItemsGridTV, sortable multirecord-TV)
    formit2db with autocreate schema&classes
    formit2resource
    custom-tv-input-type for revo:imagelistTV
    quickCMP - CMP for creating simple backend-'modules' per snippets
    bloX/Xedit - Ressource-Listing and frontend-sorting/editing....

    Bruno17 Reply #2, 1 year, 5 months ago

    Reply
    • Link to this post#2
    you can put your js-blocks in different js-chunks and create a checkbox-TV jsBlocks with input-options:

    JS A=={{jsA}}||JS B=={{jsB}}  


    in your head put
    [*jsBlocks*]


    then you can check them on or off on your pages per checkboxes.


  • 36549
    337
    www.9thwave.co.uk
       WEB | DESIGN | PRINT

    9thwave Reply #3, 1 year, 5 months ago

    Reply
    • Link to this post#3
    Hi Bruno,

    Thanks for your answer.
    Of course...i'd forgotten i could use TV's!!

    Cheers

    J





Actions

Login to Post

Other Support Options

To file a bug or make a feature request visit our issue tracker, or you can also purchase commercial support.

Love MODX?

If you build sites for a living with MODX or just love using it, why not give back?

Information

Posted in this thread:
9thwave, Bruno17

 
Back to Top

MODX Global HQ

1333 N Stemmons Fwy, Ste 110
Dallas, TX 75207
United States

+1 (469) 777-MODX (6639)

The MODX Company

  • Contact
  • Media Center
  • Careers at MODX
  • Wall of Fame
  • The MODX Blog

Sponsors

SoftLayer Firehost: Secure Cloud Hosting

Stay Connected

Read our previous email newsletters.

Twitter Facebook Google+ LinkedIn github Feeds

Privacy Policy | Terms of Service | Pixels by AKTA Web Studio© 2005-2012 MODX. All rights reserved. Trademark Policy