Help - Search - Members - Calendar
Full Version: Help with tumblr {block:IndexPage} showing on other pages
HTMLHelp Forums > Web Authoring > Web Site Functionality
hankkosovo
Hi Guys,

Basically, I have used the {block:IndexPage} tag correctly, but it is showing up on {block:SearchPage} and {block:TagPage} and I have no idea why.

Does anyone happen to know why, is this a known bug?

Below is the code that I have used:

CODE


{block:TagPage}
            <div class="post meta">            
                <span class="post-info-wrapper"></span>            
                <h2 class="title">Tags</h2>        
                <span class="post-info-wrapper"></span>        
                <span class="content">
                </span>
            </div>
        {/block:TagPage}
        
        
        
        
        {block:SearchPage}
            <div class="post meta">            
                <span class="post-info-wrapper"></span>            
                <h2 class="title">Search Results</h2>        
                <span class="post-info-wrapper"></span>        
                <span class="content">
                    <p>Your search results for {SearchQuery} has found {SearchResultCount} posts.</p>
                </span>
            </div>
        {/block:SearchPage}
    

    
    
        {block:IndexPage}
        {block:IfShowDescription}

            <div class="post meta">            
                <span class="post-date-wrapper"></span>
                <h2 class="title">{text:Description Header}</h2>
                <span class="post-info-wrapper"></span>

                <span class="content">
                    {block:IfShowPortrait}<img class="portrait" src="{PortraitURL-64}" alt="Avatar"/>{/block:IfShowPortrait}
                    {Description}
                </span>
            </div>

        {/block:IfShowDescription}    
        {/block:IndexPage}



Thanks in advance!
pandy
I guess the curlies are part of some kind of templating lingo. What is this "it" that is showing up where it shouldn't though?
hankkosovo
QUOTE(pandy @ Aug 3 2011, 07:30 PM) *

I guess the curlies are part of some kind of templating lingo. What is this "it" that is showing up where it shouldn't though?


Yeah that's correct, a lot like how wordpress works.

Basically, in tumblr if you use {block:IndexPage} {/block:IndexPage} anything that you put in between those tags will show only on the index page, but it is showing on the search and tag page as well, and I have no idea why?
pandy
Oh, you said Tumblr in the topic line. Sorry, I didn't see. No idea, I'm afraid.
m-q
From http://ejdraper.com/post/280968117/advance...-customization:

The syntax for identifying the index page refers to any type of index page, which also runs to both search result pages, and tag result pages. So this means that placing my header image solely within a {block:IndexPage} means it’d also show on both search and tag pages too, which I didn’t want. Seeing as how there is syntax for identifying a search page ({block:SearchPage}) and a tag page ({block:TagPage}), we can use these to specify a class that will cause the banner to be hidden in those circumstances, leaving it showing on the other remaining type of index page, the homepage. The code looks a little something like this:

{block:IndexPage}
<div id="index"
{block:SearchPage}class="hidden"{/block:SearchPage}
{block:TagPage}class="hidden"{/block:TagPage}>
<a href="/">
<h1 id="logo">Elliott J Draper, Freelance Developer</h1>
</a>
<div id="headings">
<div id="web">Web and mobile development</div>
<div id="rails">Ruby on Rails specialist</div>
<div id="deliver">I always deliver</div>
<div id="bank">And I won't break the bank</div>
</div>
<div class="clear"></div>
</div>
{/block:IndexPage}

And the CSS is real straightforward:

.hidden { display: none; }
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.