Page 1 of 1

Easy way to use CustomField

Posted: Thu Sep 15, 2011 11:15 pm
by LazyBadger
For one of my projects I want to use CustomField, which will contain image.
Yes, I know: I can write img src="uploads/*stars.gif", but - it's long and not bulletproof writing.
I'll prefer to write smth. like{$one}...{$ten} as CF-value
Can I do it andif yes - how?

Re: Easy way to use CustomField

Posted: Fri Sep 16, 2011 12:28 pm
by yellowled
LazyBadger wrote:For one of my projects I want to use CustomField, which will contain image.
I think the custom fields option of the extended entry properties plugin is just what you're looking for.

YL

Re: Easy way to use CustomField

Posted: Fri Sep 16, 2011 2:06 pm
by LazyBadger
Well, custom fields from ExtendedProperies is tool of choice (and was before I started topic - I just don't know another solution).
I just asked - how to write in field less text, if I have (5-10) hardcoded patterns and too lazy repeat all html every time

Re: Easy way to use CustomField

Posted: Tue Sep 20, 2011 2:21 pm
by garvinhicking
Hi!
LazyBadger wrote:Well, custom fields from ExtendedProperies is tool of choice (and was before I started topic - I just don't know another solution).
I just asked - how to write in field less text, if I have (5-10) hardcoded patterns and too lazy repeat all html every time
You only need to do that once in the plugin setup, not every time?!

You could also code a simple PHP script that creates your patterns so that you can copy&paste them:

Code: Select all

<?php
$patterns = explode('content,description,header');
$iterations = 10;
$i = 0;
while($i <= $iterations; $i++) {
  $i++;
  foreach($patterns AS $pattern) {
    echo $pattern . $i . ",";
  }
}
HTH
Garvin

Re: Easy way to use CustomField

Posted: Tue Sep 20, 2011 3:35 pm
by LazyBadger
garvinhicking wrote:
You only need to do that once in the plugin setup, not every time?!
In plugin setup I can change fields count, field name and nothing (?) more. My task is
in single field in every entry write like this (changeable parts are italicized)

Rating<br />
<img src="uploads/one.gif">&nbsp;&mdash;&nbsp;<span class="one">Terrible</span>

Using event_smarty for CF can be excellent solution

Re: Easy way to use CustomField

Posted: Thu Sep 22, 2011 4:14 pm
by garvinhicking
Hi!

Sure, you can simply enter "one" in your custom field, and then change your entries.tpl to use that placeholder to emit the complete HTML.

Regards,
Garvin