Tumblr template has closing {/block:Regular}, but no opening tag

172 Views Asked by At

I was updating my template recently when I discovered an odd error. I have a closing {/block:Regular} at the top of my posts block but no corresponding opening Regular tag.

This seems to output inside every post type even if the content is empty (I would normally use this to capture Text posts).

When I add the {block:Regular} tag above it, it seems to break my theme.

Without it my theme works correctly.

Here is the top part of the posts block

 <div id="contents"><!-- contents -->
            {block:Posts}
            <div class="post">
                <div class="content text">
                    {block:Title}<h3><a href="{Permalink}">{Title}</a></h3>{/block:Title}
                    <div class="go">
                        {Body}
                    </div>
                {/block:Regular}
                {block:Photo}
                </div>
                <div class="content image">
                    {LinkOpenTag}
                        <img src="{PhotoURL-500}" {block:HighRes}style="display:none"{/block:HighRes} />
                        {block:HighRes}
                        <img src="{PhotoURL-HighRes}" class="highres">
                        {/block:HighRes}
                    {LinkCloseTag}
                    {block:Caption}
                        <div class="description">{Caption}</div>
                    {/block:Caption}
                    <p>
                        <span class="ion-ios-infinite-outline"></span>
                        <a href="{Permalink}" class="link">{block:Date}{DayOfMonthWithZero}.{MonthNumberWithZero}.{ShortYear}{/block:Date}</a>
                    </p>
                {/block:Photo}
                {block:Photoset}
                </div>
                <div class="content photoset">
                    {block:Photos}
                        <img src="{PhotoURL-500}" {block:HighRes}style="display:none"{/block:HighRes} />
                        {block:HighRes}
                        <img src="{PhotoURL-HighRes}" class="highres" />
                        {/block:HighRes}
                        {block:Caption}
                        {Caption}
                        {/block:Caption}
                    {/block:Photos}
                    {block:Caption}
                    <div class="description">{Caption}</div>
                    {/block:Caption}
                    <p>
                        <span class="ion-ios-infinite-outline"></span>
                        <a href="{Permalink}" class="link">{block:Date}{DayOfMonthWithZero}.{MonthNumberWithZero}.{ShortYear}{/block:Date}</a>
                    </p>
                {/block:Photoset}
                {block:Quote}
                </div>
                <div class="content quote">
                    <div class="symbol">&#147;</div>
                    <div class="quote">
                        {Quote}
                    </div>
                    {block:Source}
                    <div class="description">&mdash; {Source}</div>
                    {/block:Source}
                    <p>
                        <span class="ion-ios-infinite-outline"></span>
                        <a href="{Permalink}" class="link">{block:Date}{DayOfMonthWithZero}.{MonthNumberWithZero}.{ShortYear}{/block:Date}</a>
                    </p>
                {/block:Quote}
                {block:Link}
                </div>

And although my blog displays correctly the <div class="content text"> gets inserted to the top of every post.

Correct posts with additional data

I have tried a couple of things to wrap the Regular tag properly but I think something else must be broken inside my template as although it looks OK in the browser, it's definitely bust in the console.

Have tried

 <div class="post">
                {block:Regular}
                <div class="content text">
                    {block:Title}<h3><a href="{Permalink}">{Title}</a></h3>{/block:Title}
                    <div class="go">
                        {Body}
                    </div>
                {/block:Regular}
                {block:Photo}
                </div>
                <div class="content image">

With this markup though the posts are being rendered outside of my <div id="container">

See here:

Incorrect posts

I have also tried replacing {block:Regular} with {block:Text} and the corresponding closing tags and seems to be the same issue.

I cannot find a non closed tag, so I am fairly certain the markup is correct, but maybe I am missing something.

If anyone wants the full template I will add it to a jsfiddle.

1

There are 1 best solutions below

0
On

Well I managed to solve it, by crook or hook as they say.

My markup now looks like this:

             <div id="contents"><!-- contents -->
                <ol id="posts"><!-- posts -->
                    {block:Posts}
                        {block:Text}
                            <li class="post text">
                                <div class="go">{Body}</div>
                            <p>
                                <span class="icon-link ion-ios-infinite-outline"></span>
                                <a href="{Permalink}" class="link">{block:Date}{DayOfMonthWithZero}.{MonthNumberWithZero}.{ShortYear}{/block:Date}</a>
                            </p>
                        </li>
                    {/block:Text}
                    {block:Photo}
                        <li class="post photo">
                            {LinkOpenTag}
                                <img src="{PhotoURL-500}" {block:HighRes}style="display:none"{/block:HighRes} />
                                {block:HighRes}
                                <img src="{PhotoURL-HighRes}" class="highres">
                                {/block:HighRes}
                            {LinkCloseTag}
                            {block:Caption}
                                <div class="description">{Caption}</div>
                            {/block:Caption}
                            <p>
                                <span class="icon-link ion-ios-infinite-outline"></span>
                                <a href="{Permalink}" class="link">{block:Date}{DayOfMonthWithZero}.{MonthNumberWithZero}.{ShortYear}{/block:Date}</a>
                            </p>
                        </li>
                    {/block:Photo}
                    {block:Panorama}
                        <li class="post panorama">
                            {LinkOpenTag}
                                <img src="{PhotoURL-Panorama}" alt="{PhotoAlt}"/>
                            {LinkCloseTag}
                            {block:Caption}
                                <div class="caption">{Caption}</div>
                            {/block:Caption}
                        </li>
                    {/block:Panorama}
                    {block:Photoset}
                        <li class="post photoset">
                            {block:Photos}
                                <img src="{PhotoURL-500}" {block:HighRes}style="display:none"{/block:HighRes} />
                                {block:HighRes}
                                    <img src="{PhotoURL-HighRes}" class="highres" />
                                {/block:HighRes}
                            {/block:Photos}
                            {block:Caption}
                                <div class="description">{Caption}</div>
                            {/block:Caption}
                            <p>
                                <span class="icon-link ion-ios-infinite-outline"></span>
                                <a href="{Permalink}" class="link">{block:Date}{DayOfMonthWithZero}.{MonthNumberWithZero}.{ShortYear}{/block:Date}</a>
                            </p>
                        </li>
                    {/block:Photoset}
                    {block:Quote}
                        <li class="post quote">
                            <div class="symbol">&#147;</div>
                            <div class="quote">
                                {Quote}
                            </div>
                            {block:Source}
                                <div class="description">&mdash; {Source}</div>
                            {/block:Source}
                            <p>
                                <span class="icon-link ion-ios-infinite-outline"></span>
                                <a href="{Permalink}" class="link">{block:Date}{DayOfMonthWithZero}.{MonthNumberWithZero}.{ShortYear}{/block:Date}</a>
                            </p>
                        </li>
                    {/block:Quote}
                    {block:Link}
                        <li class="post link">
                            <h3><a href="{URL}" class="link" {Target}>{Name}</a></h3>
                            {block:Description}
                                <div class="description">{Description}</div>
                            {/block:Description}
                            <p>
                                <span class="icon-link ion-ios-infinite-outline"></span>
                                <a href="{Permalink}" class="link">{block:Date}{DayOfMonthWithZero}.{MonthNumberWithZero}.{ShortYear}{/block:Date}</a>
                            </p>
                        </li>
                    {/block:Link}
                    {block:Chat}
                        <li class="post chat">
                            {block:Title}
                                <h3><a href="{Permalink}">{Title}</a></h3>
                            {/block:Title}
                            <ul class="chat">
                                {block:Lines}
                                    <li class="{Alt} user_{UserNumber}">
                                        {block:Label}
                                            <span class="label">{Label}</span>
                                        {/block:Label}{Line}
                                    </li>
                                {/block:Lines}
                            </ul>
                             <p>
                                <span class="icon-link icon-link ion-ios-infinite-outline"></span>
                                <a href="{Permalink}" class="link">{block:Date}{DayOfMonthWithZero}.{MonthNumberWithZero}.{ShortYear}{/block:Date}</a>
                            </p>
                        </li>
                    {/block:Chat}
                    {block:Video}
                        <li class="post video">
                            {Video-400}
                            {block:Caption}
                            <div class="description">{Caption}</div>
                            {/block:Caption}
                            <p>
                                <span class="icon-link ion-ios-infinite-outline"></span>
                                <a href="{Permalink}" class="link">{block:Date}{DayOfMonthWithZero}.{MonthNumberWithZero}.{ShortYear}{/block:Date}</a>
                            </p>
                        </li>
                    {/block:Video}
                    {block:Audio}
                        <li class="post audio">
                            {AudioPlayerGrey}
                            {block:Caption}
                                <div class="description">{Caption}</div>
                            {/block:Caption}
                            <p>
                                <span class="icon-link ion-ios-infinite-outline"></span>
                                <a href="{Permalink}" class="link">{block:Date}{DayOfMonthWithZero}.{MonthNumberWithZero}.{ShortYear}{/block:Date}</a>
                            </p>
                        </li>
                    {/block:Audio}
                    {block:RebloggedFrom}
                        <li>
                            <p class="description">{lang:Reblogged from ReblogParentTitle 2}</p>
                        </li>
                    {/block:RebloggedFrom}
                    {block:HasTags}
                        <li>
                            <ol class="description tags ion-ios-pricetag-outline">
                                {block:Tags}<li><a href="{TagURL}">{Tag}</a></li> {/block:Tags}
                            </ol>
                        </li>
                    {/block:HasTags}
                    {block:PostNotes}
                        <li>
                            {block:Permalink}
                            {block:IfDisqusShortname}
                            <div id="disqus_thread"></div>
                            <script type="text/javascript" src="https://disqus.com/forums/{text:Disqus Shortname}/embed.js"></script>
                            <noscript><a href="https://{text:Disqus Shortname}.disqus.com/?url=ref">{lang:View the discussion thread}</a></noscript>
                            {/block:IfDisqusShortname}
                            {/block:Permalink}
                            {PostNotes}
                        </li>
                    {/block:PostNotes}
                    {/block:Posts}
                    {block:SearchPage}
                        <li class="post">
                            {block:NoSearchResults}
                                <p>Sorry, no posts are tagged with "{SearchQuery}."</p>
                                <p><a href="/">index</a> page</p>
                            {/block:NoSearchResults}
                        </li>
                    {/block:SearchPage}
            </ol><!-- end posts -->
            {block:IndexPage}
            <div class="post">
                <div class="content nav" style="text-transform:lowercase;">
                    {block:PreviousPage}
                        <a href="{PreviousPage}" class="prev">{lang:Previous}</a> &nbsp;&nbsp;&nbsp;
                    {/block:PreviousPage}
                    ({CurrentPage}/{TotalPages})
                    {block:NextPage}
                        &nbsp;&nbsp;&nbsp;<a href="{NextPage}" class="next">{lang:Next}</a>
                    {/block:NextPage}
                </div>
            </div>
            {/block:IndexPage}
            </div>
        </div><!-- end contents -->

I must have inherited the {Block:Regular} statement from the original template and not known what it was. But I also had a non closed tag somewhere. I also converted the posts blocks to an ordered list, so semantically it's a bit clearer.

Now the output looks like this:

enter image description here