How do i check the value of paths.theme in bolt ??

Discussion for various published PHP frameworks, including Zend Framework, CodeIgniter, Kohana, CakePHP, Yii, Symfony, and others.

Moderator: General Moderators

Post Reply
User avatar
gautamz07
Forum Contributor
Posts: 331
Joined: Wed May 14, 2014 12:18 pm

How do i check the value of paths.theme in bolt ??

Post by gautamz07 »

I was just going through the code of _master.twig in the default theme in bolt and i came across the following lines of code:

Code: Select all

{% set main_width = theme.layout.main_width|default(8) %}
{% set aside_width = theme.layout.aside_width|default(4) %}
<!doctype html>
<html class="no-js" lang="{{ htmllang() }}">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="x-ua-compatible" content="ie=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        {# make sure we always display a proper title: The record's title if there is one, appended with the
           sitename. If there is no title, we append the sitename with the payoff, if there is one. #}
        <title>
            {%- if record.title is defined %}{{ record.title|striptags }} | {% endif -%}
                {{ app.config.get('general/sitename') -}}
            {% if record.title is not defined and app.config.get('general/payoff') %} | {{ app.config.get('general/payoff') }}{% endif -%}
        </title>
        <link rel="stylesheet" href="{{ paths.theme }}css/foundation.css">
        <link rel="stylesheet" href="{{ paths.theme }}css/theme.css">
        <link href='https://fonts.googleapis.com/css?family=Noto+Sans:700,700italic' rel='stylesheet' type='text/css'>
        {% block headincludes %}
        {% endblock headincludes %}
    </head>
Now what if i want to echo out or check the value of

Code: Select all

paths.theme
?? How do i do that ??

Thank you.
Gautam.
User avatar
gautamz07
Forum Contributor
Posts: 331
Joined: Wed May 14, 2014 12:18 pm

Re: How do i check the value of paths.theme in bolt ??

Post by gautamz07 »

i just did the following:

Code: Select all

{{ dump(paths.theme) }}
And i get null on in the brower, but it should have some value i believe because when in my index.twig file and i load my js files like so:

Code: Select all

<script src="js/typed.js"></script>

My JS file does not load inspite of it being the right path , but when i add the following prefix to the path:

Code: Select all

<script src="{{ paths.theme }}js/typed.js"></script>
The file loads correctly :(
Post Reply