Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-10-04 19:12:33

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 596
Website

(Another) <title> problem

My front page <title> is empty. Can anybody tell me what might cause this? Here’s the code I’m using:

<title>
    <txp:if_individual_article>
        <txp:title /> - <txp:site_name />
    <txp:else />
        <txp:if_section>
            <txp:if_section name="">
                <txp:site_name />
            <txp:else />
                <txp:section title="1" /> - <txp:site_name />
            </txp:if_section>
        </txp:if_section>
    </txp:if_individual_article>
</title>

Last edited by maruchan (2010-10-04 19:13:00)

Offline

#2 2010-10-04 20:25:31

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: (Another) <title> problem

Because of the additional attributeless <txp:if_section> statement. Remove it, it does nothing, really; w/o name attribute if_section tag won’t return anything.

Therefor we get:

<title>
    <txp:if_individual_article>
        <txp:title /> - <txp:site_name />
    <txp:else />
        <txp:if_section name="">
            <txp:site_name />
        <txp:else />
            <txp:section title="1" /> - <txp:site_name />
        </txp:if_section>
    </txp:if_individual_article>
</title>

Last edited by Gocom (2010-10-04 20:27:49)

Offline

#3 2010-10-04 20:29:13

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 596
Website

Re: (Another) <title> problem

Ah! Thanks, that seems to have worked.

Offline

#4 2010-10-04 20:30:15

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: (Another) <title> problem

w/o name attribute if_section tag won’t return anything.

Gocom, correct me if wrong, but w/o name attribute, if_section will test if current context is a section. As per maruchan’s post, it seems that home page (aka “default” section) isn’t considered a section.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#5 2010-10-04 20:46:24

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: (Another) <title> problem

maniqui wrote:

Gocom, correct me if wrong, but w/o name attribute, if_section will test if current context is a section. As per maruchan’s post, it seems that home page (aka “default” section) isn’t considered a section.

Kinda. Practically it returns true for everything else than section equals default. Section is set everywhere else if not specifically overdefined by a plugin etc.

I’ve sometimes wondered by $s is always set and why you can change the page template articles use by simply adding ?s to the URL.

Last edited by Gocom (2010-10-04 20:53:21)

Offline

Board footer

Powered by FluxBB