Inserting random text

Discuss news styles, css code, and other Coranto customizations in here...the possibilities are endless, so have at it!

Moderator: Spunkmeyer

Inserting random text

Postby Abbeyvet » Sat Sep 24, 2005 11:03 pm

I have a site that does accommodation reviews and has a single sentence that appears at the end of all reviews - a verdict you might say, which goes something like:

We recommend <Field: CustomField_PropertyName> to anyone looking for accommodation in <Field: CustomField_AreaName>

I would like to vary the actual words a bit from page to page - say have 3-4 different ways of essentially saying the same thing.

Is there any way with perl code to add something in the news style to randomise the text?

I already have about 150+ property reviews, so while I wish I had created something in the submission form to vary the text at the outset, I do not want to have to back trhough them all and add one now.

Anyone have any ideas?
Posts: 111
Joined: Thu Jan 11, 2007 11:17 am
Location: Kilkenny, Ireland

Postby Jahandar » Sun Sep 25, 2005 6:06 am

At this time, is the message placed by your style or in the post?

If it's in the post directly, you may have to use sed or something similar.

If it's in a style, you could use the field that allows you to write perl in a style. For instance, you assign a bunch of random phrases into an array @phrases then get one using $myPhrase = rand(@phrases);

If you're not familiar with using Perl in styles, this page should give you the general idea.
Generic Editor Adaptor (GEA) - Use virtually any WYSIWYG HTML Editor in Coranto
cra_RTE - WYSIWYG HTML Editor for Coranto posts
HowTo: Fix Reply Links when using ShadowMail and Private Messenger together
Posts: 64
Joined: Mon Mar 28, 2005 1:27 am
Location: USA

Postby Dale Ray » Sun Sep 25, 2005 12:51 pm

On the HowTo Page of this site check out:

Alternate CSS for every new item

Alternate background colors

Searching for "alternate background colors" in the forum should show some links with discussion.

While this appears to have nothing to do with random text the same techniques used should enable you to change the text presented when news is built.
Dale Ray
User avatar
Dale Ray
Posts: 1001
Joined: Sun Jan 19, 2003 6:02 pm
Location: NW Indiana

Return to Customization

Who is online

Users browsing this forum: No registered users and 1 guest