Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-09-19 17:25:39

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

Ajax rotating article excerpt

Hello all,

Here’s a quick rundown of what I’m trying to do.

I’d like to have a rotating article excerpt that uses AJAX.
Essentially it would be like a slideshow but instead of just images it would rotate chunks of HTML.

It’s sort of like using sort=“rand()” but it would reload the results on a specified time interval without reloading the page.

Anyone done anything like this?

Any direction would be appreciated.


Tom

Offline

#2 2007-09-19 17:47:04

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

Re: Ajax rotating article excerpt

Maybe you can do this not necessarily using AJAX but using some simple javascript (using jQuery this should be easy).
That is, you won’t fetch article excerpts “ajaxly”. They will be in your HTML the first (and only) time you load it.

You will simple show/hide them.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#3 2007-09-19 17:56:27

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

Re: Ajax rotating article excerpt

Maniqui,

Hmm…interesting. Sounds like it would achieve the results I’m after.

Any suggestions on how to make it happen?

I’m pretty limited in my programming abilities…That is, I can take things apart and rework them pretty well…but not skilled enough to create from scratch.

)


Tom

Offline

#4 2007-09-19 18:45:05

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

Re: Ajax rotating article excerpt

renobird wrote:

I’m pretty limited in my programming abilities…That is, I can take things apart and rework them pretty well…but not skilled enough to create from scratch.

I’m exactly like you :)

But let’s start from the basic: the content/HTML output you will need. Then, someone wiser than us will come with some JS magic to help.

1. You will need to output X article excerpts. <txp:article limit="X" form="excerpt" />.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#5 2007-09-19 18:51:00

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

Re: Ajax rotating article excerpt

Sounds good.

<txp:article limit="X" form="excerpt" /> is exactly right.

I think the next step is to hide all but one of them, and then show/hide the rest on some time interval.

Offline

#6 2007-09-19 20:27:28

sthmtc
Member
From: CGN, GER
Registered: 2005-01-17
Posts: 586
Website

Re: Ajax rotating article excerpt

have a look at this for example…

Offline

#7 2007-09-19 20:29:54

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

Re: Ajax rotating article excerpt

Sven,

That is sweet! …and exactly what I was looking for.
I’ll give it a go tomorrow and report back.

Cheers Mate.

Tom

Offline

Board footer

Powered by FluxBB