Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » How do I…?
  3. » Title

#1 2008-08-22 11:42:35

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Title

Hi, my current code for title on my site is:

<title><txp:if_section name="default"><txp:site_name /> - Introduce a Little Anarchy<txp:else /><txp:page_title separator=" - " /></txp:if_section></title>

What I want it to do is make it so that it will show the section title when viewing an article or category, so at the moment if i went to, domain.com/blog/1/welcome

it would just show “domain.com – welcome” in the title, what i want is it to say, “domain.com – Blog – Welcome”

Thanks. x

Last edited by driz (2008-08-22 11:43:12)


~ Cameron

Offline

#2 2008-08-22 12:40:12

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

Re: Title

You can always use Textpattern tags, including section, title, category, if_category, if_section.

In example:

<title>
	<txp:site_name />
	<txp:if_section name="">
		- Introduce a Little Anarchy
	<txp:else />
		- <txp:section title="1" />
	</txp:if_section>
	<txp:if_category>
		- <txp:category title="1" />
	</txp:if_category>
	<txp:if_individual_article>
		- <txp:title />
	</txp:if_individual_article>
</title>

Last edited by Gocom (2008-08-22 12:41:17)

Offline

#3 2008-08-22 13:21:07

driz
Member
From: Huddersfield, UK
Registered: 2008-03-18
Posts: 441
Website

Re: Title

That works quite nice, another little issue I’m having is that, my blog categories are linked to the root, so if i was on my blog and choose a cat, it would jump to domain.com/category/mycat

where as i want it to be relative to my domain.com/blog/category/mycat


~ Cameron

Offline

#4 2008-08-22 13:37:43

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

Re: Title

See attributes this_section and section for:

Yep, you can link to sections. Also you can build the links manually. The link structure would be this kind: domain.com/blog/?c=mycat. There is multiple ways to build that kind of links, only the sky is the limit.

Offline

  1. Index
  2. » How do I…?
  3. » Title

Board footer

Powered by FluxBB