This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

paulpoot
paulpoot

Hey, so I just started working with October and I'm currently looking to build a theme for my website. I created the new theme, and made a very basic homepage and default layout. When I want to preview the page, however, October throws this exception at me:

Imgur

EDIT: Problem is apparantly related to the tab you use when editing the page in October. The "code" tab is just for PHP, so use the "markup" tab if you want to edit the page structure.

Last updated

forums7529
forums7529

You don't need the <?php ?> tags or the == at the end.

paulpoot
paulpoot

I know, but these seem to be added automatically. Tried removing them, but that didn't work.

asbig
asbig

That's odd.

As forums7529 says, those extra bits shouldn't be in your default layout file.

Are you using an IDE that puts the PHP tags in automatically? What build are you using?

I've got a site running on build 251 with the following default.htm layout and it was fine:

description = "Default layout"
==
<!DOCTYPE html>
<html lang="en" id="top">
    <head>
        <meta charset="utf-8">
        <title>{{ this.page.meta_title }}</title>
        <link href="http://fonts.googleapis.com/css?family=Open+Sans:300,400" rel="stylesheet">
        <link href='http://fonts.googleapis.com/css?family=Roboto+Slab:100,300' rel='stylesheet' type='text/css'>
        <link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet">
        <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet">
        <link href="{{ [
                'assets/css/charset.css',
                'assets/css/masonry.css',
                'assets/css/modal.css',
                'assets/css/ripples.min.css',
                'assets/css/style.css',
              ]|theme }}.css" rel="stylesheet">
        <meta name="description" content="{{ this.page.meta_description }}">
        <meta name="keywords" content="{{ this.page.meta_keywords }}">
        <meta name="author" content="LRS 2015">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="msvalidate.01" content="95E86D8C2EEA617E4FC6F4F84344FA5D">
        <meta name="robots" content="index,follow">
        <link rel="icon" type="image/png" href="{{'assets/images/icons/favicon.png'|theme}}">
        <link rel="apple-touch-icon-precomposed" href="{{'assets/images/icons/apple-touch-icon-precomposed.png'|theme}}">
        <script src="{{ 'assets/js/modernizr.custom.js'|theme }}"></script>
    </head>
    <body>
        <div class="navbar navbar-default navbar-fixed-top" role="navigation">
            <!-- nav items here -->
        </div>
        {% placeholder jumbotron %}
        <section id="content-section">
            {% page %}
        </section>
        <div class="footer text-center">
            <div class="container">
                <div class="row">
                    <div class="col-md-12">
                        {% content 'footer.htm' %}
                    </div>
                </div>
            </div>
            <p><a href="#top" title="return to the top" class="scroller scroller-main scroll_top_out"><i class="fa fa-arrow-up"></i></a></p>
        </div> 
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
        <script src="{{ [
            'assets/js/jqBootstrapValidation.js',
            'assets/js/jquery.masonry.min.js',
            'assets/js/scrollreveal.js',
            'assets/js/ripples.min.js',
            'assets/js/tools.js'
            ]|theme }}.js"></script>
    </body>
</html>
paulpoot
paulpoot

I'm using a combination of Sublime Text and the built-in editor. Apparently the tags are added to the page.php whenever I create a new page using the backend. Removing the tags from the file using Sublime solved the problem.

I tried to recreate the problem with a new page, and it looks to be related to the "code" tab I used when editing the page from within October. I found some information about this tab in the documentation and apparently that was the PHP code tab. Feeling pretty stupid now :')

So, if anyone else has the same problem: use the Markup tab.

(Might be a good idea to use clearer names for the two tabs, to be honest :p)

asbig
asbig

Ha ha, got you!

Yeah, the Code tab is very different to the Markup tab.

Glad you got it sorted.

daftspunky
daftspunky

The PHP code section can contain optional open and close PHP tags to enable syntax highlighting in text editors.

Reading the documentation helps.

asbig
asbig

Reading the documentation helps.

OUCH!

1-8 of 8

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.