Hi all,
how can you create
fields with PHP-code in any position of your template that you want
Step 1:
install the great module blank module from Bob Galway - you can find this under
Custom Code in Modules it's for free!
Step 2:
create custom code:
with this code in this case you can insert pictures in any position from your template according to the values of a multiselect field - see ->
select simple / multiple with image options?:
$cck = CCK_Rendering::getInstance();
if (isset($cck->get('country')->value)) {
$extension = 'jpg'; // or gif or jpg ...
$values = explode ($cck->get('country')->divider, $cck->get('country')->value);
if (is_array($values)) {
$imgstr = '';
foreach ($values as $value) {
$imgstr .= ($value != '') ? "<img src=\"/images/$value.$extension\" alt=\"$value\" />" : '';
}
echo $imgstr;
}
}
or
to solve this question
$uri = $_SERVER['REQUEST_URI'];
$pieces = explode("/", $uri);
$uri_3 = $pieces[3];
echo "URI_3: " . $uri_3;
disable HTML, CSS and Javascript
Step 3:
create one free text in your content form at the desired position
Editor - in this example insert just {loadposition imagestring} -> imagestring in this case is position from this module
Step 4:
Positioning in the template:
Step 5:
Test it!
Enjoy
Castor