I have successfully created a 'starter' custom detail template by following Rob's video and with some forum guidance. I can retrieve fields from the data group and use html to place data as required. Very encouraging !
However I noticed that if I concatenate two fields with the php . operator each field appears on a separate line, even though the page mark-up has enough space to place both fields on the same line.
I tried using some regular expression code to strip out control characters but the result is the same.
Here is the code.
<?php
echo "<pre>";
//echo "zz1";
$contactus = $this->groups['Contact Details2'];
//print_r($contactus);
$elements = $contactus->elements;
print_r(array_keys($elements));
$name = $elements['first_name']->element;
$name1 = $elements['last_name']->element;
$name2 = $name . " " . $name1;
$string = trim(preg_replace('/\s+/', ' ', $name2));
print_r($name2);
//print_r($this->groups);
echo "</pre>";
?>
<div class="row-fluid">
<div class = "span8"><?php echo $string; ?> </div>
<div class = "span4"><?php echo $name1; ?> </div>
<div class = "span12"><?php echo "dddddddddjjjjjjjjjjjjdddddddddddddddddddddddd" . " ---- " . "bbbbbee" . $string; ?> </div>
<div class = "span12"><?php preg_replace('/[\x00-\x1F\x7F]/', '', $string); ?> </div>
</div>
The only two reasons for line breaks that I can think of are page mark up and control characters but it doesn't appear to be either. What do I need to do to display the first name and last name in the example like Peter Thomas . Thanks.
However I noticed that if I concatenate two fields with the php . operator each field appears on a separate line, even though the page mark-up has enough space to place both fields on the same line.
I tried using some regular expression code to strip out control characters but the result is the same.
Here is the code.
<?php
echo "<pre>";
//echo "zz1";
$contactus = $this->groups['Contact Details2'];
//print_r($contactus);
$elements = $contactus->elements;
print_r(array_keys($elements));
$name = $elements['first_name']->element;
$name1 = $elements['last_name']->element;
$name2 = $name . " " . $name1;
$string = trim(preg_replace('/\s+/', ' ', $name2));
print_r($name2);
//print_r($this->groups);
echo "</pre>";
?>
<div class="row-fluid">
<div class = "span8"><?php echo $string; ?> </div>
<div class = "span4"><?php echo $name1; ?> </div>
<div class = "span12"><?php echo "dddddddddjjjjjjjjjjjjdddddddddddddddddddddddd" . " ---- " . "bbbbbee" . $string; ?> </div>
<div class = "span12"><?php preg_replace('/[\x00-\x1F\x7F]/', '', $string); ?> </div>
</div>
The only two reasons for line breaks that I can think of are page mark up and control characters but it doesn't appear to be either. What do I need to do to display the first name and last name in the example like Peter Thomas . Thanks.