Welcome, Guest
Username Password: Remember me

Extra hyphen when teachers have no title
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Extra hyphen when teachers have no title

Extra hyphen when teachers have no title 20 Feb 2010 10:30 #1911

Found a bug that occurs when teachers have no title.
If teacher has no title, then their name appears as:
"Firstname Surname -"
on the teacherdisplay.. this is because we assume a title which would give:
"Firstname Surname - Title".

Change needs to be made to default.php in both:
com_biblestudy\views\teacherdisplay\tmpl
and
com_biblestudy\views\teacherlist\tmpl

In teachersdisplay, line 42 should be changed to:
 
<img src="<?php echo $image->path;?>" width="<?php echo $image->width;?>" height="<?php echo $image->height;?>" border="1" alt="<?php echo $teacher->teachername; if ($teacher->title) { echo ' - '.$teacher->title; } ?>" />
 


and line 51 should be changed to:

 
<?php if ($teacher->title) { echo ' - '.$teacher->title; }?></td></tr>
 


similar change in teacherlist - coming later...
Update: seems the forum didnt like the php code, so i've attached the file instead.
Rename the file to default.php and put in the teacherdisplay/tmpl/ directory.

File Attachment:

File Name: teacherdisplay__default.txt
File Size: 4914
Last Edit: 20 Feb 2010 17:27 by Richard Hunt.

Re:Extra hyphen when teachers have no title 20 Feb 2010 18:11 #1912

the appropriate change in teacherlist/tmpl/default.php is on lines 62 and 63:

 
<a href="index.php?option=com_biblestudy&view=teacherdisplay&id=<?php echo $item->id.'&templatemenuid='.$templatemenuid;?>"><?php echo $item->teachername;?></a>
<?php if ($item->title) { echo JText::_(' - '); echo $item->title;}?>
 


attached new file. rename as default.php

File Attachment:

File Name: teacherlist__default.txt
File Size: 3394

Re:Extra hyphen when teachers have no title 23 Feb 2010 08:24 #1920

  • Tom
  • OFFLINE
  • Administrator
  • Posts: 860
I fixed this in the 6.1x and 6.2x teacherdisplay and teacherlist views. Added an if statement - if no title then just teachername displayed. Will be reflected in 6.1.6
"You shall know the truth and the truth shall set you free." JC
  • Page:
  • 1
Time to create page: 0.76 seconds