Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: Editing a page

  1. #1
    New to the CF scene
    Join Date
    Feb 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Editing a page

    Hi guys I have a site which i made a while back but now i have decided to add a shop part. What i want to do is display the cart total and number of items on every page. I have the code to do this. Is there anyway in which i can add this to every current page without editing every page? Maybe include it in the CSS?
    The script is a javascript.
    Thanks

  • #2
    Regular Coder BoldUlysses's Avatar
    Join Date
    Jan 2008
    Location
    Winston-Salem, NC
    Posts
    938
    Thanks
    10
    Thanked 190 Times in 187 Posts
    If your site is just static (X)HTML (not dynamically-generated using a server-side language like Java, PHP or ASP) and you want to add content, then there's no way around it except to go back and edit the markup on every page. CSS is for presentation and layout.

    However, you can save yourself that trouble in the future by using Server Side Includes (SSI) as you update the site. There have been a few threads about this recently.
    matt | design | blog

  • #3
    New to the CF scene
    Join Date
    Feb 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    okay thanks for that.
    I will know for next time

  • #4
    Regular Coder
    Join Date
    Jun 2007
    Posts
    805
    Thanks
    123
    Thanked 23 Times in 23 Posts
    And if you prefer PHP, it's very easy and smart to use includes (kinda the same as SSI, but I prefer PHP). Remember to rename your .html files to .php in order to make it work.

  • #5
    Regular Coder BoldUlysses's Avatar
    Join Date
    Jan 2008
    Location
    Winston-Salem, NC
    Posts
    938
    Thanks
    10
    Thanked 190 Times in 187 Posts
    Quote Originally Posted by CaptainB View Post
    kinda the same as SSI, but I prefer PHP
    To be clear, a PHP include is a Server Side Include by definition. Did you check out the pages I linked to?
    matt | design | blog


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •