Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-05-14 18:54:14

lehan
Member
Registered: 2008-12-17
Posts: 24

Articles displaying twice on page

Greetings!

Relative Textpattern Neophyte trying to set up a webpage here:

http://www.thesquamishreporter.ca/

Can anyone help me determine why my articles are appearing twice on a page when selected??

Cheers,

Offline

#2 2010-05-14 19:06:01

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

Re: Articles displaying twice on page

Please, post a tag trace from the problem page (from your individual article page).

Offline

#3 2010-05-14 19:15:53

lehan
Member
Registered: 2008-12-17
Posts: 24

Re: Articles displaying twice on page

Thanks, however I’m not sure exactly where the tag trace ends….

<!-- txp tag trace: 
[SQL (0.0017058849334717): select name, data from txp_lang where lang='en-gb' AND ( event='public' OR event='common')]
[SQL (0.00064516067504883): select name, code, version from txp_plugin where status = 1 AND type IN (0,1) order by load_order]
[SQL (0.00066590309143066): select page, css from txp_section where name = 'default' limit 1]
[SQL (0.033857107162476): select host from txp_log where ip='99.254.26.134' limit 1]
[SQL (0.035971164703369): insert into txp_log set `time`=now(),page='/',ip='99.254.26.134',host='CPE000f66dcd8ba-CM001ac311b660.cpe.net.cable.rogers.com',refer='',status='200',method='GET']
[SQL (0.00077509880065918): select user_html from txp_page where name='home page']
[Page: home page]
<txp:page_title />
<txp:site_url />
<txp:feed_link flavor="atom" format="link" label="Atom" />
<txp:feed_link flavor="rss" format="link" label="RSS" />
<txp:css format="link" />
<txp:rsd />
<txp:if_section name="">
	[<txp:if_section name="">: true]
</txp:if_section>
<txp:section_list default_title="Home" include_default="1" sections="about, contact-us" active_class="active" break="li" include_default="1" sort="name asc" wraptag="ul" />
	[SQL (0.00060796737670898): select name, title from txp_section where name in ('about','contact-us') order by name asc]
<txp:search_input label="" button="Search" section="default" size="15" wraptag="span" />
	[SQL (0.00061202049255371): select form from txp_form where `name` = 'search_input' limit 1]
<txp:section_list active_class="active" break="li" default_title="Home" sections="news, features, education, environment, your-stories, births, weddings, obituaries, get-involved" include_default="1" wraptag="ul" />
	[SQL (0.00089502334594727): select name, title from txp_section where name in ('news','features','education','environment','your-stories','births','weddings','obituaries','get-involved') order by field(name, 'news','features','education','environment','your-stories','births','weddings','obituaries','get-involved')]
<txp:article_custom form="sidebar_listing" limit="1" pgonly="0" section="good-samaritan" sort="Posted desc" status="4" time="any" />
	[SQL (0.030817985534668): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and Section IN ('good-samaritan') order by Posted desc limit 0, 1]
	[article 3]
	[SQL (0.0011231899261475): select Form from txp_form where name='sidebar_listing']
	[Form: sidebar_listing]
	<txp:if_first_article>
		[<txp:if_first_article>: true]
	</txp:if_first_article>
	<txp:permlink>
		<txp:title />
	</txp:permlink>
	<txp:article_image thumbnail="1" />
	<txp:excerpt />
	<txp:permlink>
	</txp:permlink>
	<txp:if_last_article>
		[<txp:if_last_article>: true]
	</txp:if_last_article>
<txp:article_custom form="sidebar_listing" limit="1" pgonly="0" section="people" sort="Posted desc" status="4" time="any" />
	[SQL (0.0040760040283203): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and Section IN ('people') order by Posted desc limit 0, 1]
	[article 4]
	[Form: sidebar_listing]
	<txp:if_first_article>
		[<txp:if_first_article>: true]
	</txp:if_first_article>
	<txp:permlink>
		<txp:title />
	</txp:permlink>
	<txp:article_image thumbnail="1" />
	<txp:excerpt />
	<txp:permlink>
	</txp:permlink>
	<txp:if_last_article>
		[<txp:if_last_article>: true]
	</txp:if_last_article>
<txp:article_custom form="sidebar_listing" limit="1" pgonly="0" section="new-in-town" sort="Posted desc" status="4" time="any" />
	[SQL (0.0043251514434814): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and Section IN ('new-in-town') order by Posted desc limit 0, 1]
	[article 6]
	[Form: sidebar_listing]
	<txp:if_first_article>
		[<txp:if_first_article>: true]
	</txp:if_first_article>
	<txp:permlink>
		<txp:title />
	</txp:permlink>
	<txp:article_image thumbnail="1" />
	<txp:excerpt />
	<txp:permlink>
	</txp:permlink>
	<txp:if_last_article>
		[<txp:if_last_article>: true]
	</txp:if_last_article>
<txp:article limit="1" form="default" listform="cover_story" offset="0" pgonly="0" searchall="0" sort="Posted desc" status="4" time="any" 
/>
	[SQL (0.00059390068054199): select name from txp_section where on_frontpage != '1']
	[SQL (0.066352128982544): select count(*) from textpattern where 1=1 and Status = 4 and (now() <= Expires or Expires = '0000-00-00 00:00:00') and Section != 'about-us']
	[SQL (0.012676954269409): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and Section != 'about-us' order by Posted desc limit 0, 1]
	[article 24]
	[SQL (0.0064899921417236): select Form from txp_form where name='cover_story']
	[Form: cover_story]
	<txp:if_individual_article>
		[<txp:if_individual_article>: false]
		<txp:permlink>
			<txp:title />
		</txp:permlink>
	</txp:if_individual_article>
	<txp:posted />
	<txp:author />
		[SQL (0.0010340213775635): select RealName from txp_users where `name` = 'gghuman' limit 1]
	<txp:article_image thumbnail="0" />
	<txp:excerpt />
	<txp:permlink>
	</txp:permlink>
	<txp:category1 title="1" link="1" />
	<txp:category2 title="1" link="1" />
	<txp:image id="1" />
		[SQL (0.00061917304992676): select * from txp_image where id = 1 limit 1]
<txp:article form="default" limit="5" listform="article_listing" offset="1" pgonly="0" searchall="0" sort="Posted desc" status="4" time="any" />
	[SQL (0.013254165649414): select count(*) from textpattern where 1=1 and Status = 4 and (now() <= Expires or Expires = '0000-00-00 00:00:00') and Section != 'about-us']
	[SQL (0.011104822158813): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and Section != 'about-us' order by Posted desc limit 1, 5]
	[article 23]
	[SQL (0.00094223022460938): select Form from txp_form where name='article_listing']
	[Form: article_listing]
	<txp:if_first_article>
		[<txp:if_first_article>: true]
	</txp:if_first_article>
	<txp:permlink>
		<txp:title />
	</txp:permlink>
	<txp:article_image thumbnail="1" />
	<txp:excerpt />
	<txp:permlink>
	</txp:permlink>
	<txp:image id="1" />
	<txp:if_last_article>
		[<txp:if_last_article>: false]
	</txp:if_last_article>
	[article 22]
	[Form: article_listing]
	<txp:if_first_article>
		[<txp:if_first_article>: false]
	</txp:if_first_article>
	<txp:permlink>
		<txp:title />
	</txp:permlink>
	<txp:article_image thumbnail="1" />
	<txp:excerpt />
	<txp:permlink>
	</txp:permlink>
	<txp:image id="1" />
	<txp:if_last_article>
		[<txp:if_last_article>: false]
	</txp:if_last_article>
	[article 21]
	[Form: article_listing]
	<txp:if_first_article>
		[<txp:if_first_article>: false]
	</txp:if_first_article>
	<txp:permlink>
		<txp:title />
	</txp:permlink>
	<txp:article_image thumbnail="1" />
	<txp:excerpt />
	<txp:permlink>
	</txp:permlink>
	<txp:image id="1" />
	<txp:if_last_article>
		[<txp:if_last_article>: false]
	</txp:if_last_article>
	[article 20]
	[Form: article_listing]
	<txp:if_first_article>
		[<txp:if_first_article>: false]
	</txp:if_first_article>
	<txp:permlink>
		<txp:title />
	</txp:permlink>
	<txp:article_image thumbnail="1" />
	<txp:excerpt />
	<txp:permlink>
	</txp:permlink>
	<txp:image id="1" />
	<txp:if_last_article>
		[<txp:if_last_article>: false]
	</txp:if_last_article>
	[article 19]
	[Form: article_listing]
	<txp:if_first_article>
		[<txp:if_first_article>: false]
	</txp:if_first_article>
	<txp:permlink>
		<txp:title />
	</txp:permlink>
	<txp:article_image thumbnail="1" />
	<txp:excerpt />
	<txp:permlink>
	</txp:permlink>
	<txp:image id="1" />
	<txp:if_last_article>
		[<txp:if_last_article>: true]
	</txp:if_last_article>
<txp:section_list active_class="active" break="li" sections="rights-and-permissions, advertise, submissions, contact-us" include_default="1" wraptag="ul" />
	[SQL (0.0011429786682129): select name, title from txp_section where name in ('rights-and-permissions','advertise','submissions','contact-us') order by field(name, 'rights-and-permissions','advertise','sub

(added bc. for better display. -Els)

Last edited by els (2010-05-14 21:24:16)

Offline

#4 2010-05-14 21:34:21

lehan
Member
Registered: 2008-12-17
Posts: 24

Re: Articles displaying twice on page

Thanks for the formatting of my post ;)

Still perplexed by this. I’ve made a few sites with textpattern, but never encountered this before.

Offline

#5 2010-05-14 21:35:12

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Articles displaying twice on page

This is the tag trace of your front page, we need one from an individual article page, like http://www.thesquamishreporter.ca/index.php?id=24. But don’t bother, I found it ;)

You have two article tags on the page:

<txp:article form="default" limit="1" listform="cover_story" pgonly="0" searchall="0" searchsticky="0" sort="Posted desc" status="4" />

and

<txp:article form="default" limit="5" listform="article_listing" offset="1" pgonly="0" searchall="0" sort="Posted desc" status="4" time="any" />

On an individual article page the <txp:article /> tag will only display that individual article, because it’s context sensitive. If the second tag is meant to display the next 5 articles, you need to use <txp:article_custom />.

Offline

#6 2010-05-14 21:38:34

lehan
Member
Registered: 2008-12-17
Posts: 24

Re: Articles displaying twice on page

Could the two article tags on the front page be producing the …. uh… two articles?

This is the tag trace for an article page:

<!-- txp tag trace: 
[SQL (0.0010809898376465): select name, data from txp_lang where lang='en-gb' AND ( event='public' OR event='common')]
[SQL (0.0014679431915283): select name, code, version from txp_plugin where status = 1 AND type IN (0,1) order by load_order]
[SQL (0.00080108642578125): select ID,Section from textpattern where ID = 24 and Status >= 4 limit 1]
[SQL (0.00067400932312012): select page, css from txp_section where name = 'cover-story' limit 1]
[SQL (0.0024690628051758): select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from textpattern where ID=24 and Status in (4,5)]
[article 24]
[SQL (0.0031828880310059): select ID, Title, url_title, unix_timestamp(Posted) as uposted
			from textpattern where Posted > '2010-05-14 00:38:35' and Section = 'cover-story' and Status=4 and Posted < now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') order by Posted asc limit 1]
[SQL (0.0030789375305176): select ID, Title, url_title, unix_timestamp(Posted) as uposted
			from textpattern where Posted < '2010-05-14 00:38:35' and Section = 'cover-story' and Status=4 and Posted < now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') order by Posted desc limit 1]
[SQL (0.0019118785858154): select host from txp_log where ip='99.254.26.134' limit 1]
[SQL (0.0008699893951416): insert into txp_log set `time`=now(),page='/index.php?id=24',ip='99.254.26.134',host='CPE000f66dcd8ba-CM001ac311b660.cpe.net.cable.rogers.com',refer='',status='200',method='GET']
[SQL (0.00074982643127441): select user_html from txp_page where name='default']
[Page: default]
<txp:page_title />
<txp:site_url />
<txp:feed_link flavor="atom" format="link" label="Atom" />
<txp:feed_link flavor="rss" format="link" label="RSS" />
<txp:css format="link" />
<txp:rsd />
<txp:if_section name="">
	[<txp:if_section name="">: false]
	<txp:section />
</txp:if_section>
<txp:section_list default_title="Home" include_default="1" sections="about-us, contact-us" active_class="active" break="li" include_default="1" sort="name asc" wraptag="ul" />
	[SQL (0.00064206123352051): select name, title from txp_section where name in ('about-us','contact-us') order by name asc]
<txp:search_input label="" button="Search" section="default" size="15" wraptag="span" />
	[SQL (0.00052595138549805): select form from txp_form where `name` = 'search_input' limit 1]
<txp:section_list active_class="active" break="li" default_title="Home" sections="news, features, education, environment, your-stories, births, weddings, obituaries, get-involved" include_default="1" wraptag="ul" />
	[SQL (0.00070786476135254): select name, title from txp_section where name in ('news','features','education','environment','your-stories','births','weddings','obituaries','get-involved') order by field(name, 'news','features','education','environment','your-stories','births','weddings','obituaries','get-involved')]
<txp:article_custom form="sidebar_listing" limit="1" pgonly="0" section="good-samaritan" sort="Posted desc" status="4" time="any" />
	[SQL (0.0035200119018555): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and Section IN ('good-samaritan') order by Posted desc limit 0, 1]
	[article 3]
	[SQL (0.000640869140625): select Form from txp_form where name='sidebar_listing']
	[Form: sidebar_listing]
	<txp:if_first_article>
		[<txp:if_first_article>: true]
	</txp:if_first_article>
	<txp:permlink>
		<txp:title />
	</txp:permlink>
	<txp:article_image thumbnail="1" />
	<txp:excerpt />
	<txp:permlink>
	</txp:permlink>
	<txp:if_last_article>
		[<txp:if_last_article>: true]
	</txp:if_last_article>
<txp:article_custom form="sidebar_listing" limit="1" pgonly="0" section="people" sort="Posted desc" status="4" time="any" />
	[SQL (0.0035459995269775): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and Section IN ('people') order by Posted desc limit 0, 1]
	[article 4]
	[Form: sidebar_listing]
	<txp:if_first_article>
		[<txp:if_first_article>: true]
	</txp:if_first_article>
	<txp:permlink>
		<txp:title />
	</txp:permlink>
	<txp:article_image thumbnail="1" />
	<txp:excerpt />
	<txp:permlink>
	</txp:permlink>
	<txp:if_last_article>
		[<txp:if_last_article>: true]
	</txp:if_last_article>
<txp:article_custom form="sidebar_listing" limit="1" pgonly="0" section="new-in-town" sort="Posted desc" status="4" time="any" />
	[SQL (0.0034258365631104): 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 (now() <= Expires or Expires = '0000-00-00 00:00:00') and Section IN ('new-in-town') order by Posted desc limit 0, 1]
	[article 6]
	[Form: sidebar_listing]
	<txp:if_first_article>
		[<txp:if_first_article>: true]
	</txp:if_first_article>
	<txp:permlink>
		<txp:title />
	</txp:permlink>
	<txp:article_image thumbnail="1" />
	<txp:excerpt />
	<txp:permlink>
	</txp:permlink>
	<txp:if_last_article>
		[<txp:if_last_article>: true]
	</txp:if_last_article>
<txp:article form="default" limit="1" listform="cover_story" pgonly="0" searchall="0" searchsticky="0" sort="Posted desc" status="4" />
	[SQL (0.00063800811767578): select Form from txp_form where name='default']
	[Form: default]
	<txp:if_individual_article>
		[<txp:if_individual_article>: true]
		<txp:permlink>
			<txp:title />
		</txp:permlink>
	</txp:if_individual_article>
	<txp:posted />
	<txp:author />
		[SQL (0.00051593780517578): select RealName from txp_users where `name` = 'gghuman' limit 1]
	<txp:article_image thumbnail="0" />
		[SQL (0.00059604644775391): select * from txp_image where id = 3]
	<txp:body />
	<txp:category1 title="1" link="1" />
	<txp:category2 title="1" link="1" />
	<txp:comments_invite wraptag="p" />
	<txp:image id="1" />
		[SQL (0.00063800811767578): select * from txp_image where id = 1 limit 1]
	[SQL (0.00057816505432129): select Form from txp_form where name='comments_display']
	[Form: comments_display]
	<txp:text item="comment" />
	<txp:comments_invite textonly="1" showalways="1" showcount="0" />
	<txp:comments />
	<txp:if_comments_preview>
		[<txp:if_comments_preview>: false]
	</txp:if_comments_preview>
	<txp:if_comments_allowed>
		[<txp:if_comments_allowed>: true]
		<txp:comments_form isize="25" msgcols="45" msgrows="15" />
			[SQL (0.00059413909912109): select ip from txp_discuss_ipban where `ip` = '99.254.26.134' limit 1]
			[SQL (0.00065398216247559): select Form from txp_form where `name` = 'comment_form' limit 1]
			<txp:comments_error wraptag="ul" break="li" />
			<txp:text item="comment_name" />
			<txp:text item="comment_email" />
			<txp:text item="comment_web" />
			<txp:text item="comment_message" />
			<txp:comments_help />
	</txp:if_comments_allowed>
<txp:article form="default" limit="5" listform="article_listing" offset="1" pgonly="0" searchall="0" sort="Posted desc" status="4" time="any" />
	[Form: default]
	<txp:if_individual_article>
		[<txp:if_individual_article>: true]
		<txp:permlink>
			<txp:title />
		</txp:permlink>
	</txp:if_individual_article>
	<txp:posted />
	<txp:author />
	<txp:article_image thumbnail="0" />
		[SQL (0.00067687034606934): select * from txp_image where id = 3]
	<txp:body />
	<txp:category1 title="1" link="1" />
	<txp:category2 title="1" link="1" />
	<txp:comments_invite wraptag="p" />
	<txp:image id="1" />
	[Form: comments_display]
	<txp:text item="comment" />
	<txp:comments_invite textonly="1" showalways="1" showcount="0" />
	<txp:comments />
	<txp:if_comments_preview>
		[<txp:if_comments_preview>: false]
	</txp:if_comments_preview>
	<txp:if_comments_allowed>
		[<txp:if_comments_allowed>: true]
		<txp:comments_form isize="25" msgcols="45" msgrows="15" />
			[SQL (0.00063490867614746): select ip from txp_discuss_ipban where `ip` = '99.254.26.134' limit 1]
			[SQL (0.00068521499633789): select Form from txp_form where `name` = 'comment_form' limit 1]
			<txp:comments_error wraptag="ul" break="li" />
			<txp:text item="comment_name" />
			<txp:text item="comment_email" />
			<txp:text item="comment_web" />
			<txp:text item="comment_message" />
			<txp:comments_help />
	</txp:if_comments_allowed>
<txp:section_list active_class="active" break="li" sections="rights-and-permissions, advertise, submissions, contact-us" include_default="1" wraptag="ul" />
	[SQL (0.00063586235046387): select name, title from txp_section where name in ('rights-and-permissions','advertise','submissions','contact-us') order by field(name, 'rights-and-permissions','advertise','submissions','contact-us')]
[ ~~~ secondpass ~~~ ]
 -->

Last edited by lehan (2010-05-14 21:39:06)

Offline

#7 2010-05-14 21:41:40

lehan
Member
Registered: 2008-12-17
Posts: 24

Re: Articles displaying twice on page

Yes, it apparently does. These are the results I was looking for!

…. now onto splitting an article over multiple pages.

Offline

#8 2010-05-14 22:06:35

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Articles displaying twice on page

lehan wrote:

Could the two article tags on the front page be producing the …. uh… two articles?

If the second article tag is only meant for the front page, you can wrap it in <txp:if_section name=""></txp:if_section> tags.

Offline

#9 2010-05-16 05:33:47

lehan
Member
Registered: 2008-12-17
Posts: 24

Re: Articles displaying twice on page

Ideally, I’d like that second article tag to vanish when an article is being displayed fully. As it is now, it continues to display a list of articles below the full article.

http://www.thesquamishreporter.ca/index.php?id=24

Is there an “if” command for that?

Offline

#10 2010-05-16 06:39:20

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,000
Website GitHub

Re: Articles displaying twice on page

Is there an “if” command for that?

Yes: if_individual_article or alternatively its counterpart if_article_list.

The “if” commands are listed under conditional tags in the textbook.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB