Keyword

Removing the written_by Male

  • Joshua Huff
  • Joshua Huff's Avatar Topic Author
  • Offline
  • New Member
More
14 years 5 days ago #82428 by Joshua Huff
Removing the written_by Male was created by Joshua Huff
I would like to display the author and the link because It serves as a nice contact point for customers to reach me.   I do not want the WRITTEN_BY_MALE   to appear though.  I though I would be able to create a new template and remove the following code <?php echo K2HelperUtilities::writtenBy($this->item->author->profile->gender); ?> from the file \components\com_k2\templates\default\item.php  I also tried the other files in the template however this did nothing at all.  I was wondering if somebody with more knowledge then me could help make my life easier.

Please Log in or Create an account to join the conversation.

More
14 years 5 days ago #82429 by Simon Wells
Replied by Simon Wells on topic Removing the written_by Male
Try taking a look in language/en-GB/en-GB.com_k2.ini as well.
However, removing the code from item.php should be sufficient.

Simon
K2 Support

Please Log in or Create an account to join the conversation.

  • Joshua Huff
  • Joshua Huff's Avatar Topic Author
  • Offline
  • New Member
More
14 years 4 days ago #82430 by Joshua Huff
Replied by Joshua Huff on topic Removing the written_by Male
I actually can't find the files you are refering to on my domains server, I found the file if I unzip the k2 package to my computer though.

K2Joom said:Try taking a look in language/en-GB/en-GB.com_k2.ini as well. However, removing the code from item.php should be sufficient.

Simon
K2 Support

Please Log in or Create an account to join the conversation.

  • Joshua Huff
  • Joshua Huff's Avatar Topic Author
  • Offline
  • New Member
More
14 years 4 days ago #82431 by Joshua Huff
Replied by Joshua Huff on topic Removing the written_by Male
Actually I figured out I figured I would post this as an article just in case it can save somebody else some time. I should have search the folders first for the actual phrase WRITTEN_BY_MALE because when I search the folders using dreamweaver for written_by it produce to many results. If you desire to accomplish a similar thing as I acheived on this page Custom decks in NJ you can do this by finding the file located at /components/com_k2/helpers/utilities.php open it up and at around line 60-75 you will see the following code
// Gender
function writtenBy($gender) {

if (is_null($gender))
return JText::_('WRITTEN_BY');

if ($gender == 'm')
return JText::_('WRITTEN_BY_MALE');

if ($gender == 'f')
return JText::_('WRITTEN_BY_FEMALE');

}

Simply change it as your desired to have nothing show up you would delete the text between parenthesis making sure to leave the hypothesizes <-- if thats the proper spelling. so it should look like the following

// Gender
function writtenBy($gender) {

if (is_null($gender))
return JText::_('');

if ($gender == 'm')
return JText::_('');

if ($gender == 'f')
return JText::_('');

}
Then save the file and re upload. I always make sure I use the actual file off my server. Hope this can help somebody save some time.

Please Log in or Create an account to join the conversation.

More
14 years 4 days ago #82432 by Simon Wells
Replied by Simon Wells on topic Removing the written_by Male
Hi Josh,
OK, good result.
This is an issue though, in v2.3 the JText will be linked to the language file which would be better to change than other core files.

Simon
K2 Support

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum