Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-03-07 21:22:44

elstrausso
Member
Registered: 2008-09-25
Posts: 49
Website

Override Form causes Article to repeat.

When I use the “Override Form” on an article, it works, but it also repeats the article again at the end of the article list. I’m not sure why this occurs and could use any suggestions or tips.

Link to the problem page (first article “Twitter Status” repeats at end of page.)
thedept.com

Thanks!
-Elstrausso

Last edited by elstrausso (2009-03-07 21:26:33)

Offline

#2 2009-03-07 22:31:33

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

Re: Override Form causes Article to repeat.

It would help if you’d post the code you have on your page to display the articles, and/or the tag trace.

Offline

#3 2009-03-07 22:39:12

elstrausso
Member
Registered: 2008-09-25
Posts: 49
Website

Re: Override Form causes Article to repeat.

Hello, Here is the code from my site. thx- Elstrausso

****Code for the Override Form:

<!— PROJECT CELL: TWITTER_form —>
<txp:if_article_list>
<ul class=“cells”>
<li class=“gallery”>
<div class=“cellblock”>
<txp:if_individual_article>
</txp:if_individual_article>
<h5><txp:title /></h5>
<txp:body />

</txp:if_individual_article>
</div>
</li>
</ul>
</txp:if_article_list>

***Here is the Page Code:

<!— container —>
<div id=“container”>
<div id=“fixedcontainer”>

<!— header —>
<txp:output_form form=“header” />

<!— center —>
<div id= “content”>
<div class= “blogcontent”>
<!— txp:if_category —>
<h2><txp:category title=“1” /></h2>

<div class=“hfeed”>

<txp:article form=“archive” limit=“15” pageby=“0” pgonly=“0” sort=“Posted desc” status=“4” allowoverride=“1” />
<txp:else />

<txp:if_search>
<h2><txp:text item=“search_results” />: <txp:page_url type=“q” /></h2>
</txp:if_search>
<div class=“hfeed”>
<txp:article limit=“15” />
<txp:if_individual_article>

</txp:if_category>
</div>
</div>

<!— footer —>
<txp:output_form form=“footertext” />

<!— Google Analytics —>
<txp:output_form form=“googleanalytics” />
</body>
</html>

Last edited by elstrausso (2009-03-07 22:42:40)

Offline

#4 2009-03-07 22:47:01

elstrausso
Member
Registered: 2008-09-25
Posts: 49
Website

Re: Override Form causes Article to repeat.

also, here is the code for the regular/standard form i use on the page:

<!— PROJECT CELL: Project_form —>
<txp:if_article_list>
<ul class=“cells”>
<li class=“gallery”>
<div class=“cellblock”>
<txp:if_individual_article>
</txp:if_individual_article>
<h5><txp:title /></h5>
<txp:wet_article_thumb />
<txp:body />
<p class=“read-more”> <a href=”<txp:permlink />#body”
title=”<txp:title />”>&#187;View More</a> </p> <hr></hr>
<div class=“date”><txp:posted /> Posted By: <txp:author />
<p class=“tags”><txp:category1 title=“1” link=“1” /> + <txp:category2 title=“1” link=“1” /></p>
<txp:comments_invite wraptag=“p” />

<txp:else />

<!—DETAIL PAGE —>
<div class= “celltitler”>
<h5><txp:title /></h5>
<txp:if_excerpt>
<txp:excerpt />
</txp:if_excerpt>
<div class=“entry-content”>
<p class=“tags”><txp:category1 title=“1” link=“1” /> + <txp:category2 title=“1” link=“1” /></p>
</div>
</div>
</div>
</div>
<div class= “nextprev”>
<div class =“cellprevnext”>Next: <txp:link_to_prev showalways=“1”> <txp:prev_title /></txp:link_to_prev>
</div>
<div class =“cellprevnext”>Prev: <txp:link_to_next showalways=“1”><txp:next_title /></txp:link_to_next>
</div>
<div class =“cellprevnext”><a href=“http://thedept.com/index.php?s=projects”> Projects Gallery </a>
</div>
</div>
<txp:hak_article_image linktype=‘page’ link=‘1’ linktitle=‘txp:caption’ wraptag=“li” form=“hakimage” />

<br/>
<txp:comments />
<txp:comments_form />
</txp:if_individual_article>
</div>
</li>
</ul>
</txp:if_article_list>

Offline

#5 2009-03-08 00:16:28

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

Re: Override Form causes Article to repeat.

Whoa, sorry to say this, but that code is a bit of a mess… it’s not easy to find where the problem lies. There are several incorrect conditional tags (empty pairs, closing tags without opening tags), and also you are for instance opening div, ul and li tags in the first part of the condition, and closing them in the ‘else’ part, which renders invalid xhtml. You’d better address this first, then it’s easier to see where and why the actual tags don’t function. (The validator will help you.)

As an example, here is what I would make of your regular form.

<!-- PROJECT CELL: Project_form -->

<txp:if_article_list>

	<txp:if_first_article><ul class="cells"></txp:if_first_article>
		<li class="gallery">
			<div class="cellblock"> 
			<h5><txp:title /></h5> 
			<txp:wet_article_thumb /> 
			<txp:body />  
			<p class="read-more"> <a href="<txp:permlink />#body" title="<txp:title />">»View More</a></p><hr />
			<div class="date"><txp:posted /> Posted By: <txp:author /></div>
			<p class="tags"><txp:category1 title="1" link="1" /> + <txp:category2 title="1" link="1" /></p>
			<txp:comments_invite wraptag="p" />
			</div>
		</li>
	<txp:if_last_article></ul></txp:if_last_article>

<txp:else />

	<!--DETAIL PAGE -->
	<div class= "celltitler">
	<h5><txp:title /></h5>
	<txp:if_excerpt>
		<txp:excerpt />
	</txp:if_excerpt>
	</div>
	<div class="entry-content"> 
	<p class="tags"><txp:category1 title="1" link="1" /> + <txp:category2 title="1" link="1" /></p>
	</div>

	<div class="nextprev">
	<div class="cellprevnext">Next: <txp:link_to_prev showalways="1"> <txp:prev_title /></txp:link_to_prev>
	</div>
	<div class="cellprevnext">Prev: <txp:link_to_next showalways="1"><txp:next_title /></txp:link_to_next>
	</div>
	<div class="cellprevnext"><a href="http://thedept.com/index.php?s=projects"> Projects Gallery </a>
	</div>
	</div>

	<txp:hak_article_image linktype='page' link='1' linktitle='txp:caption' wraptag="li" form="hakimage" /> 

	<br />
	<txp:comments /> 
	<txp:comments_form />

</txp:if_article_list>

Offline

#6 2009-03-08 00:24:59

elstrausso
Member
Registered: 2008-09-25
Posts: 49
Website

Re: Override Form causes Article to repeat.

Hi Els, yes, I must apologize for my bad code, i guess you can tell I’m more of a design guy than a code guy ;) I’m trying though.
I really appreciate the code suggestions/fixes. I will go ahead and fix those errors you mentioned and try the validator again.

Thanks for the help, i really appreciate it!
Elstrausso

Offline

#7 2009-03-08 00:44:32

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

Re: Override Form causes Article to repeat.

Please post again if it doesn’t solve your problem.

Offline

#8 2009-03-17 00:26:49

elstrausso
Member
Registered: 2008-09-25
Posts: 49
Website

Re: Override Form causes Article to repeat.

Hello Els,

Using the http://validator.w3.org/ I was able to knock down my errors from “70” to just “4”. However these last 4 have me really stumped.

Been testing out changes on this section of my site:
http://www.thedept.com/archive

Any suggestion I would greatly appreciate it.

Best,
Elstrausso

My Updated form code:

<!-- PROJECT CELL: ProjectArchive_form2Test -->
<txp:if_article_list>

	<txp:if_first_article><ul class="cells"></txp:if_first_article>
		<li class="gallery">
			<div class="cellblock"> 
			<h5><txp:title /></h5> 
			<txp:wet_article_thumb /> 
			<txp:body />  
			<p class="read-more"> <a href="<txp:permlink />#body" title="<txp:title />">»View More</a></p><hr />
			<div class="date"><txp:posted /> Posted By: <txp:author /></div>
			<p class="tags"><txp:category1 title="1" link="1" /> + <txp:category2 title="1" link="1" /></p>
			<txp:comments_invite wraptag="p" />
			</div>
		</li>
	<txp:if_last_article></ul></txp:if_last_article>

<txp:else />

	<!--DETAIL PAGE -->
	<div class= "celltitler">
	<h5><txp:title /></h5>
	<txp:if_excerpt>
		<txp:excerpt />
	</txp:if_excerpt>

	<div class="entry-content"> 
	<p class="tags"><txp:category1 title="1" link="1" /> + <txp:category2 title="1" link="1" /></p>
	</div>
</div>
	<div class="nextprev">
	<div class="cellprevnext">Next: <txp:link_to_prev showalways="1"> <txp:prev_title /></txp:link_to_prev>
	</div>
	<div class="cellprevnext">Prev: <txp:link_to_next showalways="1"><txp:next_title /></txp:link_to_next>
	</div>
	<div class="cellprevnext"><a href="http://thedept.com/index.php?s=archive"> Archive Gallery </a>
	</div>
	</div>

<txp:hak_article_image  linktype='page'  link='0' linktitle='txp:caption'  wraptag="li" /> 

	<br />
	<txp:comments /> 
	<txp:comments_form />

</txp:if_article_list>

(Edit: added bc.. for better code display. -Els)

Last edited by els (2009-03-17 17:36:46)

Offline

#9 2009-03-17 02:20:06

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: Override Form causes Article to repeat.

You’re not closing the container div and then you have some badly formed links missing a space before target


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#10 2009-03-17 23:01:18

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

Re: Override Form causes Article to repeat.

elstrausso wrote:

I was able to knock down my errors from “70” to just “4”.

Well done! Matt is right:

You’re not closing the container div

Meaning: add one more </div> just before </body>. For a better overview I usually add something like this after the closing tags:

</div><!-- closing container -->

and then you have some badly formed links missing a space before target

Actually it’s only one link: <a href= "http://www.textpattern.com" target="_blank"> in the footer. Remove the space after href=.

Tip: the validator has the option ‘show source’. If you check that, it will display the page source with the line numbers, so you can easily find the error causing code.

Looking at your site, I think the problem with the duplicated articles is solved?

Offline

#11 2009-03-18 01:15:06

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: Override Form causes Article to repeat.

I thought it was just that one with the space also but there was also a link with a missing space
type="application/rss+xml"target="_blank">The Dept. RSS Feed</a>


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#12 2009-03-18 04:12:19

elstrausso
Member
Registered: 2008-09-25
Posts: 49
Website

Re: Override Form causes Article to repeat.

Matt D and Els!

That worked! Passed Validation!
Thanks again for the help!

Best,
Elstrausso

Offline

Board footer

Powered by FluxBB