Topic: [Snippet] Random Teasers snippet (and chunks)  (Read 5739 times)

Pages: [1]   Go Down

#1: 23-Nov-2005, 05:33 AM

gbt
Posts: 23

WWW
Originally developed for Etomite version 6.0 onwards but should work in MODX.

I developed this snippet to call 9 different chunks of HTML code in random order.

Save the snippet code as RandomTeasers, copy and amend the chunk coding as explained in the comments, and add the css coding to your main site css file.

Usage [!RandomTeasers!] on a page. Refreshing a page generates the chunks in a different order.

However the output could also generate a sidebar with random or  static chunks as follows.

See http://www.ansteymethodist.org home page for a sidebar example. Here I have commented out the shuffle command, added a fourth chunk call to the left table, and commented out the middle and right tables to produce a static sidebar on the right of the home page.

The attached file contains the snippet, chunk and css coding required.

Hope this might be of interest. Let me know what you think, and whether you are able or need to use it on your site.

Oh, and before anyone says my coding in inefficient - IT WORKS !

* randomteasers.txt (5.64 KB - downloaded 659 times.)
« Last Edit: 25-Nov-2005, 08:54 AM by gbt »
Gordon.
My Etomite web site http://www.gbtamc.co.uk/et
My main web site http://www.gbtamc.co.uk
My blog site http://www.gbtamc.co.uk/blog
My photo gallery http://www.gbtamc.co.uk/spgm

#2: 23-Nov-2005, 09:55 AM

Emeritus
Mark
Posts: 3,250

Ditto Developer

WWW
Thanks for the snippet!

#3: 3-Mar-2006, 03:23 PM

Testers

Dimmy
Posts: 2,001

Я не говорю по-русски 私は日本語を話さない

WWW
would it be posible to use document tv's instead of chucks?

I have a folder containing document with articles
every article hase a quote from the article in a tv.

on the homepage I have a div where I like to get a random quote with a link to the document the quote comes from.

would that be posible or schould I seek somwhere els?  (doe newslising support random doc?)

Greets Dimmy

#4: 3-Mar-2006, 03:52 PM

Emeritus
Djamoer
Posts: 1,495

No one can limit a man other than the man himself.

WWW
would it be posible to use document tv's instead of chucks?

I have a folder containing document with articles
every article hase a quote from the article in a tv.

on the homepage I have a div where I like to get a random quote with a link to the document the quote comes from.

would that be posible or schould I seek somwhere els?  (doe newslising support random doc?)

Greets Dimmy

That will be nice Wink

#5: 3-Mar-2006, 04:24 PM

Testers

Dimmy
Posts: 2,001

Я не говорю по-русски 私は日本語を話さない

WWW
Got it worked out by adapting one of Jareds great snippets:

http://modxcms.com/forums/index.php/topic,3190.0.html

Greets Dimmy
« Last Edit: 3-Mar-2006, 04:33 PM by Dimmy »

#6: 6-Apr-2006, 10:16 AM

gbt
Posts: 23

WWW
Just a little feadback please.

This post read several hundred times and over 100 downloads.

Is anyone using it on their site ?

If so would appreciate details.
Gordon.
My Etomite web site http://www.gbtamc.co.uk/et
My main web site http://www.gbtamc.co.uk
My blog site http://www.gbtamc.co.uk/blog
My photo gallery http://www.gbtamc.co.uk/spgm

#7: 12-Apr-2006, 09:22 PM

Emeritus
Djamoer
Posts: 1,495

No one can limit a man other than the man himself.

WWW
Just a little feadback please.

This post read several hundred times and over 100 downloads.

Is anyone using it on their site ?

If so would appreciate details.

lol, that's one of the problem when you create a stable snippet/resource. Usuall people won't even bother giving a feedback, unless if they found something wrong with the scripts that you create. So if you see a lot of people downloading it and nobody ever complained about it, most of the times that your snippets works just fine Wink

It's just my 2 cents though Cheesy
Pages: [1]   Go Up
0 Members and 1 Guest are viewing this topic.