Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-03-12 17:01:23

reptilerobots
Member
Registered: 2005-08-20
Posts: 72

showing section titles but not when it's the default section

been messing around with this for a few hours

I want to display the site name (VIRAL ART) on the default page’s title, (in the head of the html) but not the section of “default” next to it, but on other sections I want to display the site name and the section

so.. on default, it should just read “VIRAL ART” not “VIRAL ART | default”

on the “black and white” it should say “VIRAL ART | BLACK AND WHITE

on color “VIRAL ART | COLOR” etc…

I can get this to work, but I can’t get the default section title to not appear. Here’s the last code I was working with.

<code>
<txp:if_section name=“default”>
<title><txp:sitename /></title>
<txp:else />
<title><txp:sitename /> | <txp:section title=“1” /></title>
</txp:if_section>
</code>

I know I can just use the <code><txp:sitename /> </code> tag in the page title and add “COLOR” and “BLACK AND WHITE” as hard coded html, but for future reference Id rather do it this way, in case I had a website with like 30 sections or something.

Offline

#2 2006-03-12 17:14:42

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: showing section titles but not when it's the default section

There is no name for the default section so your first tag should read <code><txp:if_section name=”“></code>. Does that fix it for you?


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#3 2006-03-12 17:19:50

reptilerobots
Member
Registered: 2005-08-20
Posts: 72

Re: showing section titles but not when it's the default section

ah yes! thanks man! You see, its little things like that.. totally overlooked.

Offline

#4 2006-03-12 17:22:04

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: showing section titles but not when it's the default section

No problem. :)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

Board footer

Powered by FluxBB