Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-10-31 02:47:21

hamsteralliance
Member
Registered: 2007-12-13
Posts: 10

Make an Exerpt expand into an Article

Hey all. :)

I’m working on a webpage with someone and we’d like to have it so that when you click on the permlink instead of loading a new page with the article, the article would load in-place where the excerpt was. In my limited knowledge of this sort of thing, the word AJAX jumps out as the appropriate term for such loading-without-refreshing-the-whole-page.

Is there a plugin or any textpattern-specific ways to make it happen? It would be awesome if it were a toggleable option in the write tab.

Thanks for any help on this,

Offline

#2 2009-10-31 15:51:31

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Make an Exerpt expand into an Article

Depending on your level of OCD you can try a non-AJAX solution:

1) you load both the excerpt and the full article body on the page. 2) you use some jQuery magic to:
  • hide the full article body
  • make a mechanism to show the full body (and hide the excerpt) when clicking on a “Read more” link.

Then, a poorman AJAX solution:

1) you use some AJAX jQuery magic (.load()) to fetch the whole permlink page when clicking on the permlink
2) then, on that fetched page, you use some jQuery magic to just grab the DOM element that holds the full article body
3) you insert that DOM element where the excerpt is, and remove the excerpt.

Hope that helps to begin with.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#3 2009-10-31 16:59:17

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: Make an Exerpt expand into an Article

The non-Ajax solution that Maniqui suggests isn’t difficult to do at all and you can probably find out everything you need to know in this jQuery tutorial and then in this one.

Offline

#4 2009-11-02 19:02:06

hamsteralliance
Member
Registered: 2007-12-13
Posts: 10

Re: Make an Exerpt expand into an Article

Awesome. I’ll look into that and give it a shot.

Thanks! :D

Last edited by hamsteralliance (2009-11-02 19:02:35)

Offline

Board footer

Powered by FluxBB