SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict swaraj_here's Avatar
    Join Date
    Jan 2007
    Location
    India
    Posts
    224
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Perl template with css integration

    I am trying bit hard to use style sheet elements in .tpl page in perl script.
    For that I have linked the style sheet in the header as <link href="times.css" rel="stylesheet" type="text/css" /> but it is not working: please help me its urgent:

  2. #2
    SitePoint Wizard bronze trophy KevinR's Avatar
    Join Date
    Nov 2004
    Location
    Moon Base Alpha
    Posts
    1,053
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    keep in mind that the link to the style sheet is relative to the folder the .tpl file is being displayed from. If your script that opens and displays the tpl file is in the cgi-bin the style sheet would also have to be in the cgi-bin, and that would most likely not work since the cgi-bin usually only serves up scripts to the www and not other documents. If you never know where the tpl file will be displayed from, use an absolute URL (not a file path but a url starting with http://www.yourdomain.com/ ) to the css file, which is slow since a DNS lookup and all that garbage has to be done. But if you do know, place the style sheet in a folder just above the cgi-bin (or where ever appropriate) and use a realtive path to the css file: link="style/style.css" and hopefully that will work. Where "style" is the name of the folder the style.css file is stored in.

  3. #3
    SitePoint Addict swaraj_here's Avatar
    Join Date
    Jan 2007
    Location
    India
    Posts
    224
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    Quote Originally Posted by KevinR View Post
    keep in mind that the link to the style sheet is relative to the folder the .tpl file is being displayed from. If your script that opens and displays the tpl file is in the cgi-bin the style sheet would also have to be in the cgi-bin, and that would most likely not work since the cgi-bin usually only serves up scripts to the www and not other documents. If you never know where the tpl file will be displayed from, use an absolute URL (not a file path but a url starting with http://www.yourdomain.com/ ) to the css file, which is slow since a DNS lookup and all that garbage has to be done. But if you do know, place the style sheet in a folder just above the cgi-bin (or where ever appropriate) and use a realtive path to the css file: link="style/style.css" and hopefully that will work. Where "style" is the name of the folder the style.css file is stored in.
    let me substantiate the contents' placements:

    The file that is executing is in the folder
    \\win2ksrv\c$\Program Files\Apache Software Foundation\Apache2.2\cgi-bin\times\times.pl

    and this is calling the template means the .tpl file which is located in
    \\win2ksrv\c$\Program Files\Apache Software Foundation\Apache2.2\cgi-bin\times\templates\start.tpl, start.tpl file is containing the css file, now you make clear where I should place the css file.

  4. #4
    SitePoint Wizard bronze trophy bluedreamer's Avatar
    Join Date
    Jul 2005
    Location
    Middle England
    Posts
    3,403
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    If your templates are in cgi-bin\times\templates then put the times.css css file in the same folder and reference it as <link href="times.css" rel="stylesheet" type="text/css" />

  5. #5
    SitePoint Wizard bronze trophy KevinR's Avatar
    Join Date
    Nov 2004
    Location
    Moon Base Alpha
    Posts
    1,053
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bluedreamer View Post
    If your templates are in cgi-bin\times\templates then put the times.css css file in the same folder and reference it as <link href="times.css" rel="stylesheet" type="text/css" />
    Won't work unless the cgi-bin is setup in a manner to allow www read access to non-script files.

  6. #6
    SitePoint Wizard bronze trophy KevinR's Avatar
    Join Date
    Nov 2004
    Location
    Moon Base Alpha
    Posts
    1,053
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    \\win2ksrv\c$\Program Files\Apache Software Foundation\Apache2.2\cgi-bin\times\times.pl

    What is the URL to the website? Is it localhost? How do you access the above from a web browswer?


Bookmarks

Posting Permissions

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