2 element next to each others

eric258

Member
hi there

how can I have 2 elements next to each others in the div view
i ld like to have a logo next to the check sign
upload_2016-6-24_16-51-52.png

ps i cannot change template :)
 
I can think of three options.

1. Create a custom fabrik template based on the div template.
2. Override the css
3. Instead of displaying the elements themselves, use a single calc element that contains the layout you want. I have this in one of my sites. The calc element is the only thing that is shown in list view, it contains html and fabrik placeholders. This approach allows you to use conditional formatting based on element values. The code example below renders a link only if members have not chosen to hide their contact details, some labels change depending on membership type, an img tag is placed in the code if a photo has been included in the post and a website link is shown if that has been included. It also does a bit of tidying up using the php str_replace function.

The code builds a variable, $nitem, which is what gets displayed. You also need to put some custom css either in fabrik's custom css file or your template's for the classes you include in your html. I use my template's because I like to have all my css in one place for ease of maintaining things.

Code:
$year_left = '{member_news___year_left}';
$honour_type = '{member_news___honour_type}';
$maiden_name = '{member_news___maiden_name}';
$profile_link = '{member_news___profile_link}';
$date = new DateTime('{member_news___date_time}');
$posted = $date->format('d-m-Y');

If ($profile_link != '') {
  $molink = '<a href="' . $profile_link . '">';
  $mclink = '</a>';
} Else {
  $molink = '';
  $mclink = '';
}

$nitem = '<h3>' . $molink . '{member_news___name}';
If ($maiden_name != '') { $nitem .= ' (' . $maiden_name . ')'; }
$nitem .= $mclink . '</h3>';
$nitem .= '<div class="postmeta">Posted: ' . $posted . ' ';
If ($year_left != 0) {
  $nitem .= 'Left: ' . $year_left;
} Else {
  $nitem .= $honour_type . ' Member';
}
$nitem .= '</div>';
$nitem .= '<p>';
If ('{member_news___photo}' != '') { $nitem .= '<img class="newsphotol" src="{member_news___photo}" alt="{member_news___name}" />'; }
$nitem .= '{member_news___news}</p>';
If ('{member_news___website_description}' != '' and '{member_news___website_link}' != '') {
  $nitem .= '<p><a href="{member_news___website_link}" target="_blank">{member_news___website_description}</a></p>'; }
$nitem = str_replace ("\r\n" , "</p><p>" , $nitem);
$nitem = str_replace ("</p><p></p>" , "</p>" , $nitem);

return $nitem;
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top