Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Title and article body, with no line break
Hi Textpattern community,
Does anyone know if it’s possible to write a form with the title on the same line as the article body? I was thinking about something like I saw on a blog on the New York Times. (Sorry, that link goes to the list, not the individual article, because it’s different on the permalink. The post I’m thinking about is titled “President’s Art Panel Names 25 Members.” Sorry, I hope this post doesn’t get buried before you see this.)
I like the way it breaks up the rhythm between larger posts and was hoping to do the same thing. However, I can’t seem to write a nice form. This is what I have now:
<p><h5><txp:permlink><txp:title /></txp:permlink></h5>|<span class="entry-content"><txp:body /></span></p>
But in this case, I get a line break after the title, and a paragraph break after the | character. Removing that character doesn’t help.
Btw, the class “entry-content” just describes how some links appear. The body and h4 are:
body {
margin: 0;
padding: 0;
font-family: Verdana, "Lucida Grande", Tahoma, Helvetica, sans-serif;
color: #000;
background-color: #fff;
font-size:75%;
}
h5 {
font-size:1em;
font-weight: bold;
margin: 0 0 0 0;
padding: 0 0 0 0;
}
I hope I’m being clear. Thanks if anyone has some advice.
Offline
Offline
Re: Title and article body, with no line break
You shouldn’t do this:
<p><h5> ...
and
<span><p><txp:body /> ...
when body is textiled.
It’s not valid.
Try something like this:
<strong class="heading"><txp:permlink><txp:title /></txp:permlink></strong><txp:body />
and the CSS:
.heading {
float: left
}
Digital nomad, sailing the world on a sailboat: 32fthome.com
Offline
#4 2009-11-05 22:08:20
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Title and article body, with no line break
If you want to keep the <h5>
for the article title you can also do something like this:
<div class="entry-content">
<h5><txp:permlink><txp:title /></txp:permlink></h5>|<txp:body />
</div>
and style both .entry-content h5
and .entry-content p
with display: inline; float: left;
.
Offline
Re: Title and article body, with no line break
NYTimes is probably doing it similar to how Els suggests since their html does include the p tag.
<div class="entry-content">
<!-- date published -->
<span class="timestamp published" title="2009-11-03T10:05:59-05:00"><span class="date">November 3, 2009, <em>10:05 am</em></span></span>
<h5 class="entry-title"><a href="http://thecaucus.blogs.nytimes.com/2009/11/03/presidents-art-panel-names-25-members/" rel="bookmark" title="Permanent Link to President’s Art Panel Names 25 Members">President’s Art Panel Names 25 Members</a> | </h5>
<p>President Obama named a host of entertainers and celebrities to the President’s Committee on the Arts and Humanities. <a href="President’s Committee on the Arts and Humanities,">Read the list at our sib-blog, ArtsBeat</a>.</p>
</div>
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: Title and article body, with no line break
Oh, duh, why didn’t I think to look at the source html of the NYT website? Duh!
Trench, that ugly stupid doubled-up code is bad! You’re right, thanks!
Thank you els for the clear solution. I hope? I’m going to try to get this done now.
Offline