Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2005-11-22 08:55:45
- gratzo
- New Member
- Registered: 2005-11-22
- Posts: 3
Clean up TXP generated HTML for article lists
Just started using an article_custom form for creating a list of articles in a section, and would like the raw html for each list item as a single line item, not one long string of text that stretches across the page.
the form code is:
<code>
<li><txp:permlink><txp:title /></txp:permlink></li>
</code>
the page template code is:
<code>
<div id=“subnav”>
<ul>
<txp:section />
<txp:article_custom form=“headline” section=“TestSection” />
</ul>
</div>
</code>
What I’d like to see in the generated html output (if possible) is:
<code>
<ul id=“mainnav”>
<li><a href=“some_address1”>Sample Page 1</a></li>
<li><a href=“some_address2”>Sample Page 2</a></li>
<li><a href=“some_address3”>Sample Page 3</a></li>
</ul>
</code>
What I’m getting is:
<code>
<ul id=“mainnav”>
<li><a href=“some_address1”>Sample Page 1</a></li><li><a href=“some_address2”>Sample Page 2</a></li><li><a href=“some_address3”>Sample Page 3</a></li>
</ul>
</code>
All of the code between the first <li>
and the last </li>
are on one line…not a huge deal, but it’d be nice to be able to read the code without scrolling across the page, especially if the list is long.
I’m a newb to TextPattern, so go easy! (and I did search for about 2 hours on the forum and FAQ’s first)
Offline
Re: Clean up TXP generated HTML for article lists
Just add a carriage return to the end of your headline form.
Code is topiary
Offline
#3 2005-11-22 15:58:14
- gratzo
- New Member
- Registered: 2005-11-22
- Posts: 3
Re: Clean up TXP generated HTML for article lists
Outstanding…that was easy enough!! Now if I could get rid of the whitespace after my Article paragragh tags, and before the “comment_invite” I’d be set!! There seems to be at least 2 lines of carriage return being created from somewhere.
This is the area I’m cleaning up, I’ve inserted the words “whitespace here” where there is a line of whitespace:
<code>
<div id=“rc”>
<h2>Test Article 1</h2>
<p>Test Article 1 Test Article 1</p>
whitespace here
<p>Test Article 1 Test Article 1 Test Article1</p>
whitespace here
whitespace here
<p class=“comments_invite” />
</div>
</code>
I tried the same logic with that but can’t seem to clear that section up. I’ll keep trying!!
Offline
Re: Clean up TXP generated HTML for article lists
Now if I could get rid of the whitespace after my Article paragragh tags, and before the “comment_invite”
I think you’re going to have to live with it, unless you want to start hacking your TXP install.
Code is topiary
Offline
#5 2005-11-22 16:34:55
- gratzo
- New Member
- Registered: 2005-11-22
- Posts: 3
Re: Clean up TXP generated HTML for article lists
I can live with it…it’s just that TXP generates such clean code, I thought I’d clear up that last little piece. Thanks for your help and quick response.
Offline