Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7083861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:13:50+00:00 2026-05-28T07:13:50+00:00

how do we include style sheets from a template file in smarty? ca we

  • 0

how do we include style sheets from a template file in smarty?

ca we use a relative path or does it have to be n absolute path?

structure might look like

project
|-- library
    |-- css
        |-- style.css
|--template
   |--index.tpl
|--template_c

in the index.tpl what would be the proper format to access style.css?

would it ../library/css/style.css? or
/project/library/css/style.css?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T07:13:51+00:00Added an answer on May 28, 2026 at 7:13 am

    It depends on what you want to do.

    If your goal is to have the browser access the css file, you need to specify the path relative to the document root. so, if your project lies within htdocs, it might be /project/library/css/style.css.

    If your goal is to read the CSS within Smarty (say to inline it) you need to specify the absolute file path (e.g. /home/users/foo/project/library/css/style.css)

    Accessing files relative to the current template file works with ./file and ../file – but only for {include} and {extends}. Everything else must either be absolute or relative to the CWD (current working directory) of the actually executed script.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We include the CSS file via standard HTML STYLE tag. Then we need the
I have modified my notebook's stylesheet to include a StyleData[Todo] that inherits from StyleData[Item]
I have a php file that reads data from my mysqldb as a json
When I call image_url('path/to/image.png') in my css.scss file, I get this error: ActionView::Template::Error (Unrecognized
My problem is I can't seem to use @RenderSection from a nested template when
I'm trying to cobble together a php style include function for javascript. The route
in AS2.0 you would include key->val style params in the param embed and object
in my settings.py I have the following: PROJECT_DIR = os.path.dirname(os.path.realpath(__file__)) MEDIA_ROOT = os.path.join(PROJECT_DIR,'templates') MEDIA_URL
stylesheet_link_tag and javascript_include_tag have stopped working after I updated rails from 2.x to 3.1.3
I am trying to obtain html from the WebBrowser control, but it must include

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.