Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2007-10-23 06:36:08
- ferenczi
- Member
- Registered: 2005-01-31
- Posts: 67
[resolved] another "crossing information blocks" question
After exhaustively scouring the forum I came across a fairly old post which discusses what I’m trying to achieve .
Likes marios, I need to break a single article into three discrete units: (1) article body, (2) article excerpt, (3) pullquote, appearing on a different part of the page, offering additional info about what is featured in the article body.
A promising and straightforward solution seems to have been reached, but I’m stymied when I try to implement it. Following Ace of Dubs suggestion, I changed custom_field_1 from varchar(255) to text and modified txp_article.php. So now I have a field below “excerpt” called “blurb”. Maybe it’s just that I’ve been staring at this for too long, but I’m having a hell of time wrapping my mind around how to output this. Nothing I’ve tried seems to work.
Here’s the scenario. I’m building (txp 4.0.5) a simple, two-column site for a musician. He has a couple of videos (more to be added later) of performances in a section called “video”. Each video is contained in an article (one article appearing at a time in the left column). I’m using excerpts to list the videos in the right column. Below this list in the right column, I want a pullquote describing the video. I thought that I could use my modified custom field (“blurb”) for the text of the pullquote. I.e., if video A is playing, the text in the “blurb” field of that article will appear in the right column. If video B is playing, the text for that article will appear.
Does this new field I’ve created function as a custom field, or as an excerpt? Does it matter? How can I get what’s contained in this field to appear in the sidebar?
I feel as though I’ve lost all cerebral capacity. Mentally challenged.
Any help would be appreciated!
Last edited by ferenczi (2007-10-23 14:16:53)
Offline
Re: [resolved] another "crossing information blocks" question
“blurb” is — technically speaking — a custom field and should be visible when your article form contains a <txp:custom_field name="blurb" />
element
Offline
#3 2007-10-23 07:37:23
- ferenczi
- Member
- Registered: 2005-01-31
- Posts: 67
Re: [resolved] another "crossing information blocks" question
Thanks. What seems to be tripping me up is outputting this custom field separately (on a different part of the page) from the article. So therefore I’ll need two separate forms, right? And the form for the custom “blurb” field will need somehow to be inextricably linked to the form containing the body of the article. I’m able to do this with the excerpt, but can’t seem to figure out how to do it with the custom field. What am I missing here?
Offline
Re: [resolved] another "crossing information blocks" question
Think big.
Make an article form which renders all divs
etc. which contain parts of the article, don’t restrict yourself to “just the center column”. Extract items from the page template and drag them into the article form, until you can address all per-article elements from one single form.
Offline
#5 2007-10-23 07:45:29
- ferenczi
- Member
- Registered: 2005-01-31
- Posts: 67
Re: [resolved] another "crossing information blocks" question
By the way, meant to thank you, wet, for responding so quickly.
Not sure if this will help clarify what I’m trying to do, but…
On the left side of the page, the main body of the article appears. Called thus:
<txp:article form="video" limit="1" sortby="Title" sortdir="asc" section="media" excerpted="1" listform="video" />
On the right side of the page, a list of links corresponding to the videos (currently just two in the list, more to be added), called thus: bc. <txp:article_custom section=“media” listform=“excerpt_list” sortby=“Title” sortdir=“asc” limit=“10” />
And my excerpt_list form:
<a href="<txp:permlink />"><txp:excerpt /></a>
Last edited by ferenczi (2007-10-23 13:08:42)
Offline
#6 2007-10-23 07:59:53
- ferenczi
- Member
- Registered: 2005-01-31
- Posts: 67
Re: [resolved] another "crossing information blocks" question
Our posts crossed, wet.
Interesting advice. I would love to think big, but (a) I’m too brain-dead/retarded at the moment and (b) having been fairly immersed in CSS and XHTML for several years, I just don’t see how that could work in practical terms.
The part of the article that contains the video is contained within a div called #left. The excerpt list and, I hope, the blurb, are contained in a div called “right”.
Oh, wait. You’re saying that I should construct this particular article form as if it were an entire page, basically? Putting the divs in the article form? Hm. Yikes. That seems to go against what one always strives for, which is a fairly rigorous separation of form and content.
Why is it that I can separate out the excerpt without resorting to constructing an article form like a page, but I can’t separate out a custom field?
Okay, off to try to do this. It feels very much like a workaround, but maybe this is the only way to accomplish what I’m trying to do.
Thanks again.
Offline
Re: [resolved] another "crossing information blocks" question
ferenczi wrote:
That seems to go against what one always strives for, which is a fairly rigorous separation of form and content.
I beg to differ. The content is that stuff you enter in the “write article screen”, presentation is both forms and pages (and style sheets). So there’s no semantical difference between article forms and pages with respect to your principles.
Offline
#8 2007-10-23 08:20:04
- ferenczi
- Member
- Registered: 2005-01-31
- Posts: 67
Re: [resolved] another "crossing information blocks" question
You’re right. I stand corrected!
Thanks again for your help.
Offline
#9 2007-10-23 09:21:53
- ferenczi
- Member
- Registered: 2005-01-31
- Posts: 67
Re: [resolved] another "crossing information blocks" question
Okay. I did what you recommended, and I thought that I had gotten it to work. But unfortunately, the excerpt_list, which allows the user to select one video or another and causes the selected video to play on the left side of the page, no longer functions when I try to do it this way.
Here’s some pseudocode of how I tried to set up the video page.
<div id="left">
<txp:article_custom excerpted="1" listform="vidpage" limit="1" pgonly="0" section="media" sort="Title asc" />
</div>
<div id="right"
<div class="excerpts"><txp:article_custom section="media" listform="excerpt_list" sortby="Title" sortdir="asc" limit="10" />
</div>
</div>
<div id="copyright"><txp:output_form form="copyright" /></div>
</div>
</body>
</html>
And here’s the form (type = article) called “vidpage”:
<h2 class="video"><txp:title /></h2>
<txp:body />
</div>
<div id="right">
<div id="nav">
.
.
.
</div>
<div class="rightcontent">
<div class="openquote">“</div>
<txp:custom_field name="blurb" /><br />
<div class="closequote">”</div>
</div>
And here’s how I set up a subnav so that users can choose which video they want to watch, using a form (type = link) called “excerpt_list”:
<a href="<txp:permlink />"><txp:excerpt /></a>
I feel like I’m on the right track, thanks to wet, but there’s something I’m clearly not getting.
Last edited by ferenczi (2007-10-23 13:05:45)
Offline
Re: [resolved] another "crossing information blocks" question
If I understand you correctly, on an individual article page, you want the main content, together with a list of links to other articles and ‘further over’ the rest of the article/blurb. I think you’re best off making three forms, one for the main area, one for the list of links and one for the “rest of the article”/blurb. In your page template use txp:article for the main area, txp:article_custom for the list of links to other articles, and txp:article again with another form for the blurb. It’s off the top of my head but I think that should work.
TXP Builders – finely-crafted code, design and txp
Offline
#11 2007-10-23 13:20:38
- ferenczi
- Member
- Registered: 2005-01-31
- Posts: 67
Re: [resolved] another "crossing information blocks" question
Except I think it’s more complicated, jakob. It would be great if I could just make three separate forms. But the blurb that appears in the sidebar has to correspond to whichever video is playing in the main content area.
So when I add content to this section, I link to an .swf (flv) in the main body of the article; in the excerpt field I repeat the title; in my new “blurb” custom field I add the text that describes the video.
Say I have video A. The text in the blurb field needs to be all about the video A. I also have video B. The text in the blurb field, if video B is playing, needs to be all about video B. When the user first loads the page, by default video A will start playing and the blurb that appears in the sidebar needs to be specifically about video A. Then, say the user wants to watch video B. He or she clicks on that link (which is actually an excerpt). Video B appears in the main content area. The blurb that now appears in the sidebar must be about video B.
One possibility I thought of, but haven’t tried yet because it seems like kind of a hack, is to add the blurb as a comment. But not have all of the comment paraphernalia—just the simple body of the comment, which could appear in the sidebar.
Thanks for your response.
Offline
#12 2007-10-23 14:15:50
- ferenczi
- Member
- Registered: 2005-01-31
- Posts: 67
Re: [resolved] another "crossing information blocks" question
Got it! It works now, just like wet knew it would.
My mistake, an oversight, was a typical “article” vs “article_custom” error…
Offline