Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-10-06 02:53:27

sirNemanjapro
Member
From: Čačak, Serbia
Registered: 2007-12-08
Posts: 59
Website

To display only body of article in jQuery ThickBox

One problem is buging me. Im still thinking about the solution but its better to ask, than not.

Here is the “deal”.

On index page I have box that displays titles and time of publish of recent news article. When I click on it, it should show me only the body of the article.

I tried to find solution like this.
On the index page I created an output form for those recent news.
<txp:output_form form="knu_mini_news" />

The form “knu_mini_news” contains
http://pastebin.com/m5acded3b

And the “knu_male_vesti” from “knu_mini_news” contains
http://pastebin.com/m345bcfdb

Now, the section uses the page mininews that has page stripped out of everything, here it is.
http://pastebin.com/m7440a142

And the form that it uses is just has BODY tag in it.

But when I click on the link, back on the index page, the thickbox displays all articles that are posted. I dont understand how can I bind them to work. So when I click one title it displays its body of article and nothing more.

I hope I wasnt to confusing. :S

Thanks in forward.


“… they were enterprising voyages…” – Mr. Spock ( from Spock vs. Q )

Offline

#2 2008-10-06 09:06:28

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

Re: To display only body of article in jQuery ThickBox

on knu mini news you have:
<txp:article_custom allowoverride=“0” form=“knu_male_vesti” limit=“5” pgonly=“0” sort=“Posted desc” section=“mini_news” status=“4” time=“any” />

if you want only one article to show you need

<txp:article_custom allowoverride=“0” form=“knu_male_vesti” limit=“1” pgonly=“0” sort=“Posted desc” section=“mini_news” status=“4” time=“any” />


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

#3 2008-10-06 09:59:44

sirNemanjapro
Member
From: Čačak, Serbia
Registered: 2007-12-08
Posts: 59
Website

Re: To display only body of article in jQuery ThickBox

I want one article to show when I click on the link. I need 5 of them on the index page. I tried that, before I asked for help here, and couldn’t hit the answer.

If you have time, can we use some IM to solve this. Its simple problem, but hard to explain with writing about it. :)
Do you have ICQ? How can I contact you?

Last edited by sirNemanjapro (2008-10-06 10:02:04)


“… they were enterprising voyages…” – Mr. Spock ( from Spock vs. Q )

Offline

#4 2008-10-06 13:46:53

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: To display only body of article in jQuery ThickBox

I’m not 100% sure – but I think this might be what you are trying to do:

Take a look at the news in the left column.

I can tell you how I made that happen if it’s indeed what you are after.


Tom

Last edited by renobird (2008-10-06 13:47:17)

Offline

#5 2008-10-06 23:24:38

sirNemanjapro
Member
From: Čačak, Serbia
Registered: 2007-12-08
Posts: 59
Website

Re: To display only body of article in jQuery ThickBox

Thats it, renobird! :)


“… they were enterprising voyages…” – Mr. Spock ( from Spock vs. Q )

Offline

#6 2008-10-08 04:05:52

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: To display only body of article in jQuery ThickBox

Did you get it worked out? If not, I’d be glad to help.


Tom

Offline

#7 2008-10-08 07:13:53

sirNemanjapro
Member
From: Čačak, Serbia
Registered: 2007-12-08
Posts: 59
Website

Re: To display only body of article in jQuery ThickBox

No I didnt. Can you help please?


“… they were enterprising voyages…” – Mr. Spock ( from Spock vs. Q )

Offline

#8 2008-10-13 01:36:50

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: To display only body of article in jQuery ThickBox

Sorry it took me so long to get back to you on this.
Hope this helps.

In the <head> of your document
<link rel="stylesheet" href="/path/to/thickbox.css" type="text/css" />
<script type="text/javascript" src="/path/to/jquery.js"></script>
<script type="text/javascript" src="/path/to/thickbox.js"></script>

<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
$('#newsarticles').hide();
});
//]]>
</script>

In the <body> of your document you need to create a hidden container for the content you want to show in your thickbox modal.

I put this as the last things before I close the <body> tag.
This content will get loaded on your page – but will remain hidden via the jquery above. It will only get shown in the thickbox modal.

<div id="newsarticles">
<txp:article_custom section="news" form="news_article" limit="10" />
</div>

Contents of the news_article form referenced above
<div id="news_hidden_<txp:article_id />">
<txp:title />
<span><txp:body /></span>
</div>

In the <body> of your document where you want your list of news article titles to be displayed

<ul id="newslist>
<txp:article_custom section="news" form="news-linklist" limit="10" />
</ul>

Contents of the news_linklist form referenced above
<li>
<a href="/#TB_inline?height=350&width=500&inlineId=news_hidden_<txp:article_id />" title="<txp:title />" class="thickbox"><txp:title /></a>
</li>

Offline

Board footer

Powered by FluxBB