PHP Developers Network
http://forums.devnetwork.net/

How do i check the value of paths.theme in bolt ??
http://forums.devnetwork.net/viewtopic.php?f=72&t=143017
Page 1 of 1

Author:  gautamz07 [ Wed Oct 05, 2016 7:42 pm ]
Post subject:  How do i check the value of paths.theme in bolt ??

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:

Syntax: [ Download ] [ Hide ]
{% 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
Syntax: [ Download ] [ Hide ]
paths.theme
?? How do i do that ??

Thank you.
Gautam.

Author:  gautamz07 [ Wed Oct 05, 2016 7:51 pm ]
Post subject:  Re: How do i check the value of paths.theme in bolt ??

i just did the following:

Syntax: [ Download ] [ Hide ]
{{ 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:

Syntax: [ Download ] [ Hide ]
<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:

Syntax: [ Download ] [ Hide ]
<script src="{{ paths.theme }}js/typed.js"></script>


The file loads correctly :(

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/