have you installed OpenCATS? Proud of your customizations and want to share it? Post here and wait for the praise...

Moderators: RussH, cptr13

Forum rules: Just please remember to play nicely once you walk through the door. You can disagree with us, or any other commenters in this forum, but keep your comments directed to the topic at hand - not at the commenter.
User avatar
By PersonalAgentin
#4521
I created a simple text field during the job posting and can also output it.

How can I check a field if it contains any value or a certain value?
#4526
I have created a field "Driver's license". This field contains the required driving licence class. I only want to display the content of the field if something has been entered.

*** if !<extraField-Driving Licence>=='' ***
<tr>
<td class="detailsHeader"><strong>needed licence class:</strong></td>
<td><extraField driving licence></td>
</tr>
*** endif ***

No one has an idea? Or is that not possible?
User avatar
By rob
#4531
You are going to have to put some logic in the Show.tpl files when the extra fields are displayed for each of the modules in question.
Assuming you just need to modify candidates everything you need to do is below.

So for example on the Candidates it's in modules/candidates/Show.tpl
Code: Select all
 
Orig code:
<?php for ($i = (intval(count($this->extraFieldRS))/2); $i < (count($this->extraFieldRS)); $i++): ?>
  <tr>
     <td class="vertical"><?php $this->_($this->extraFieldRS[$i]['fieldName']); ?>:</td>
     <td class="data"><?php echo($this->extraFieldRS[$i]['display']); ?></td>
  </tr>
 <?php endfor; ?>
Code: Select all
Modified code:
<?php for ($i = (intval(count($this->extraFieldRS))/2); $i < (count($this->extraFieldRS)); $i++): ?>
 <tr>
   <?php if($this->extraFieldRS[$i]['fieldName'] == "Driver's license") {  ?>
			<?php if ($this->extraFieldRS[$i]['display']){  ?>
				  <td class="vertical"><?php $this->_($this->extraFieldRS[$i]['fieldName']); ?>:</td>
				  <td class="data"><?php echo($this->extraFieldRS[$i]['display']); ?></td>
			<?php } ?>
   <?php }else{ ?>
		  <td class="vertical"><?php $this->_($this->extraFieldRS[$i]['fieldName']); ?>:</td>
		  <td class="data"><?php echo($this->extraFieldRS[$i]['display']); ?></td>
   <?php } ?>
 </tr>
<?php endfor; ?>


Note: On these Show.Tpl pages there are 2 columns displaying the fields so that means there are 2 different sections in the code that handle the extra fields. So if you change this and its not reflecting on the site, you added it to the opposing column.

Discover Women Seeking Casual Encounters Tonight […]

Discover Women Looking for Spontaneous Nights Out[…]

okay - strange as disk is cheap! However if you wa[…]

Can anyone assist me? Much appreciated.