PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Wed Jun 19, 2019 7:13 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed Oct 05, 2016 7:42 pm 
Offline
Forum Contributor
User avatar

Joined: Wed May 14, 2014 12:18 pm
Posts: 331
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.


Top
 Profile  
 
PostPosted: Wed Oct 05, 2016 7:51 pm 
Offline
Forum Contributor
User avatar

Joined: Wed May 14, 2014 12:18 pm
Posts: 331
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 :(


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group