<p>I think I'm following and it sounds like the job for a <a href="http://buildwithcraft.com/docs/plugins/introduction" rel="nofollow">plugin</a> with a custom <a href="http://buildwithcraft.com/docs/plugins/field-types" rel="nofollow">field type</a>.</p>

<p>In your example, since you want to use a <a href="http://buildwithcraft.com/docs/dropdown-fields" rel="nofollow">Dropdown</a> field, then your plugin's field type could extend Craft's default Dropdown field type.</p>

<p>When populating the field type's default values (from your pre-defined statements), you could then randomly select which ones are selected on new entries).</p>

CC BY-SA 3.0
2015-09-15T07:19:55.310Z
Thanks Brad, I'll dig into it, about time I understood more about writing plugins.
Pathfinder
CC BY-SA 3.0
2015-09-14T22:14:26.783Z
2015-09-14T22:14:26.783Z
Brad Bell
<p>I am working on a site for a client who posts many jobs for chefs.</p>

<p>A lot of the jobs are essentially similar, so writing the job postings is something I am trying to simplify.</p>

<p>I can write a series of statements that will serve up similar job descriptions, with pre-written statements that then use |replace to integrate other field data.</p>

<p>So an example statement:</p>

<p>We cook %jobFoodType% to %jobRatingStars%.</p>

<p>Would render as:</p>

<p>'We cook Pub food to a 3 star rating.'</p>

<p>I can write many of these type of statements which can either be selected from a drop down, but I'd like to go a step further and have the drop down when entering a new entry, to be randomly selected from the list of options.</p>

<p>So what I'm asking for, is there a way Craft can randomly pre-populate a field, with a set of predefined statements.</p>

<p>I've had a look at Randomm plugin, which while useful, doesn't let me pre-populate from a predefined set of statements like sentences.</p>

<p>The alternative is to use Randomm to create a random number I use to pick a statement that is in the template, but for obvious reasons, I'd prefer the statements to be driven from Craft.</p>

<p>Any help / thoughts much appreciated. Thank you.</p>

CC BY-SA 3.0
2015-09-14T20:45:13.420Z
I'm confused... you're putting a heavy emphasis on this being a _random_ process, but it seems like you're trying to generate very _specific_ results. What exactly is "random" about it?
Lindsey D
CC BY-SA 3.0
2015-09-15T07:18:55.940Z
The random aspect is which of the predefined statements is selected. For example I could have 10 statements and when I create a new job entry, one of these is picked at random and saved in the entry.
Pathfinder
<random>
Random Field Entries
# Random Field Entries

(Asked by: username_0 on 2015-09-14)

I am working on a site for a client who posts many jobs for chefs.

A lot of the jobs are essentially similar, so writing the job postings is something I am trying to simplify.

I can write a series of statements that will serve up similar job descriptions, with pre-written statements that then use |replace to integrate other field data.

So an example statement:

We cook %jobFoodType% to %jobRatingStars%.

Would render as:

'We cook Pub food to a 3 star rating.'

I can write many of these type of statements which can either be selected from a drop down, but I'd like to go a step further and have the drop down when entering a new entry, to be randomly selected from the list of options.

So what I'm asking for, is there a way Craft can randomly pre-populate a field, with a set of predefined statements.

I've had a look at Randomm plugin, which while useful, doesn't let me pre-populate from a predefined set of statements like sentences.

The alternative is to use Randomm to create a random number I use to pick a statement that is in the template, but for obvious reasons, I'd prefer the statements to be driven from Craft.

Any help / thoughts much appreciated. Thank you.

**Tags:** random
> **Comments:**
> **username_1**: I'm confused... you're putting a heavy emphasis on this being a _random_ process, but it seems like you're trying to generate very _specific_ results. What exactly is "random" about it?  
> **username_0**: The random aspect is which of the predefined statements is selected. For example I could have 10 statements and when I create a new job entry, one of these is picked at random and saved in the entry.  

---

## 1 answers

### Answer by username_2 on 2015-09-14. Score: 1 | Accepted answer

I think I'm following and it sounds like the job for a [plugin](http://buildwithcraft.com/docs/plugins/introduction) with a custom [field type](http://buildwithcraft.com/docs/plugins/field-types).

In your example, since you want to use a [Dropdown](http://buildwithcraft.com/docs/dropdown-fields) field, then your plugin's field type could extend Craft's default Dropdown field type.

When populating the field type's default values (from your pre-defined statements), you could then randomly select which ones are selected on new entries).

> **Comments:**
> **username_0**: Thanks Brad, I'll dig into it, about time I understood more about writing plugins.  

---

