Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-11-14 21:13:39

matgorb
Member
Registered: 2005-06-12
Posts: 31

How to clean up my head

Because I wanted to have section name in my section listing title, and the <txp:section /> doesn’t seem to work —for me— in the head for the title, I had to use conditional.
It works great but it leaves big empty white space in the source code of my pages. Is there a way to solve it without removing the return carriage after every conditional statement, which will make my form unreadable?
I can do with an alternate solution too.

<code>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>

<html xmlns=“http://www.w3.org/1999/xhtml” xml:lang=“se” lang=“se”>

<head>

<meta http-equiv=“content-type” content=“text/html; charset=utf-8” />

<link rel=“alternate” type=“application/rss+xml” title=“RSS” href=“http://www.radio86.se/rss” />

<style type=“text/css” media=“screen”>@import “<txp:css />”;</style>

<title>
<txp:if_individual_article>
<txp:page_title />
<txp:else />
<txp:if_section name=”“>Radio86 Sverige: Allt om Kina!</txp:if_section>
<txp:if_section name=“culture”>Radio86 Sverige: Kultur &amp; Nöje</txp:if_section>
<txp:if_section name=“report”>Radio86 Sverige: Reportage</txp:if_section>
<txp:if_section name=“travel”>Radio86 Sverige: Resa</txp:if_section>
<txp:if_section name=“olympics”>Radio86 Sverige: OS 2008</txp:if_section>
<txp:if_section name=“facts”>Radio86 Sverige: Fakta</txp:if_section>
<txp:if_section name=“news”>Radio86 Sverige: Nyhetsarkiv</txp:if_section>
<txp:if_section name=“podradio”>Radio86 Sverige: Podradio</txp:if_section>
<txp:if_section name=“radioinfo”>Radio86 Sverige: Radio Program</txp:if_section>
</txp:if_individual_article>
</title>

</head>
</code>

Offline

#2 2005-11-14 21:53:06

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

Re: How to clean up my head

Hi matgorb.
No te compliques! (do not complicate yourself!).

First, you have ob1_title plug-in to add more options to title tag (including the section name).

Second, your code is not “optimized”.
You can simple to the following to achieve the same result you do with that long code you posted:

<code>
<title>
<txp:if_individual_article>
<txp:page_title />
<txp:else />
<txp:if_section name=”“>Radio86 Sverige: Allt om Kina!
<txp:else />
Radio86 Sverige: Kultur & Nöje: <txp:section title=“1” />
</txp:if_section>
</txp:if_individual_article>
</title>
</code>

Finally, read the manual entry for built-in txp:page_title
As it says, you cannot use it to add the section name in the title.

Last edited by maniqui (2005-11-14 23:58:57)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#3 2005-11-15 09:42:25

matgorb
Member
Registered: 2005-06-12
Posts: 31

Re: How to clean up my head

Yup I know about the title, however I tried with the txp:section earlier, and it didn’t work, but guess what, it does now so thanks a lot, it might be because of the if section.

Anyway thanks! mercie, gracie or whatever

mat

Offline

Board footer

Powered by FluxBB