Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-11-23 13:24:16

roelof
Member
Registered: 2005-03-27
Posts: 647

who can explain this ? section question

hello,

In my website i have two sections :

voorpagina and articles.

Section voorpagina looks like this :

Section name : voorpagina
section title : voorpagina
page : default
style : default
use as standard section : yes
on the frontpage : yes
xml feed : yes

Sectionname : articles
section title : articles
page : default
style : default
use as standard section :no
on the frontpage : no
xml feed : yes.

But when i do this:

<div id="content">
<txp:if_section name="default">
  <txp:article_custom section="voorpagina" form="default" />
   </txp:if_section>

<txp:if_section name=“articles”>

When i now do a article which is section articles then i get the frontpage text.
Here a tag trace :

[<txp:if_section name="default">: true]
	<txp:article_custom section="voorpagina" form="default" />
		[SQL (0,000844955444336): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = 0) and Section IN ('voorpagina') order by Posted desc limit 0, 10]
		[artikel 9]
		[SQL (0,000181198120117): select Form from txp_form where name='default']
		[Module: default]
		<txp:title />
		<txp:body />
			<txp:upm_image type="image" image_id="4" class="image" />
				[SQL (0,000974178314209): select * from txp_image where id = '4' limit 0, 1]
		<txp:comments_invite wraptag="p" />
</txp:if_section>
<txp:if_section name="articles">
	[<txp:if_section name="articles">: false]
</txp:if_section>

Can someone explain why this happens ?

Roelof

Offline

#2 2008-11-23 13:58:22

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

Re: who can explain this ? section question

The tag trace looks correct for the code you posted. I’m not exactly sure what problem you are having. What I can say is that because you are only allowing the “voorpagina” section onto the front-page you can use the <txp:article /> tag instead of the <txp:article_custom /> tag. As this is using the “default” form there is no need to use the “form” attribute as this is the default anyway. So I would modify the code to something like:-

<txp:if_section name="default">
<txp:article />
</txp:if_section>
<txp:if_section name="articles">
<txp:article form="formName" />
</txp:if_section>

Having said that, if there is no need to use different “forms” for the different sections then you don’t need any of the conditional tags. All you need is the <txp:article /> tag. You only need to use conditionals if there are differences in the layout of the sections.


Stuart

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

Offline

#3 2008-11-23 14:23:32

roelof
Member
Registered: 2005-03-27
Posts: 647

Re: who can explain this ? section question

Hoi Stuart,

The different sections does have different layouts.

What i don’t get is that i have a article of the section articles , the <if section=“default” is true and <if section =“articles”> is false.
I expected that default becomes false and articles becomes true.

Roelof

Roelof

Offline

#4 2008-11-23 14:32:54

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

Re: who can explain this ? section question

Got a link Roelof? One thing I thought of and I know you’ve been using TXP for a while, some time ago the “articles” section used to be called “article”. Just check that.


Stuart

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

Offline

#5 2008-11-23 14:41:24

roelof
Member
Registered: 2005-03-27
Posts: 647

Re: who can explain this ? section question

the articles section is called articles. If you want i can get you a login so you can see it for yourself.

I working at http://test2.tamarawobben.nl

And yes, i have been using txp for a while but some things i never understand fully how they work.
TXP is still a mystery for me.

Roelof

Roelof

Offline

#6 2008-11-23 20:05:22

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

Re: who can explain this ? section question

Yes, please send a login over to stuart at thebombsite dot com. I need a look inside methinks.


Stuart

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

Offline

#7 2008-11-23 21:25:19

roelof
Member
Registered: 2005-03-27
Posts: 647

Re: who can explain this ? section question

hoi Stuart,

I gave you a login.
I changed the page template so it works.
But still the articles in the section “articles” are true when section = default.

Roelof

Roelof

Offline

#8 2008-11-24 15:08:00

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

Re: who can explain this ? section question

Got it. I’ll have a quick look.


Stuart

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

Offline

#9 2008-11-24 15:25:32

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

Re: who can explain this ? section question

You have both sections set to appear on the front-page. You need to change “articles”. It’s the second option down not the first option. ;)


Stuart

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

Offline

#10 2008-11-24 15:34:10

roelof
Member
Registered: 2005-03-27
Posts: 647

Re: who can explain this ? section question

Hoi Stuart,

Correct, i did that because otherwise there will be no articles visible on the articles section.

Roelof

Offline

#11 2008-11-24 18:27:13

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

Re: who can explain this ? section question

OK. The only thing is that now you have modified the code I can’t really look for what might have been causing the original problem. ;)


Stuart

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

Offline

#12 2008-11-24 18:50:45

roelof
Member
Registered: 2005-03-27
Posts: 647

Re: who can explain this ? section question

oke

But the original problem still exist.
The original problem was and is that articles which are in the section articles are true when txp looks if there are in de section default.

Roelof

Offline

Board footer

Powered by FluxBB