Rename Fax Field

Hello, I would like to add social url ie facebook to location info instead of fax which no one uses any more. Is there any way to rename the fax field label to Social ?
Thanks
Paul

Comments

  • Hi,

    It's possible to rename the field using Language Overrides: https://dj-extensions.com/faq/dj-classifieds-faq/how-to-change-add-new-advert-or-any-other-text-in-dj-classifieds

    The constants you are looking for would be:
    COM_DJCATALOG2_LOCATION_FAX
    COM_DJCATALOG2_UP_FAX
  • Thanks Olo, That works but unfortunately it does not display as a link just plain text and it looks like it truncates the text. Anyway round that ?
  • Hi,

    You mean that the value of attribute is plain text? That's correct - neither Joomla! nor the component exchange URLs to clickable anchor links. To do that you would have to edit layout files and convert value by yourself:

    /components/com_djcatalog2/views/item/tmpl/default_map.php
    /components/com_djcatalog2/views/items/tmpl/default_items.php
    /components/com_djcatalog2/views/items/tmpl/default_table.php
  • edited August 14
    Yes to make the fax field behave like the www field. I will edit files unless there is a better way to provide links to social media pages such as facebook.
    Thanks
  • edited August 30
    I can get this working in the table but not the items form ? I have edited /default_items.php and default_map.php as follows

    if (($this->params->get('location_fax_item', 1) == '1') && $item->fax) {
    $fax = (strpos($item->fax, 'http') === 0) ? $item->fax : 'http://'.$item->fax;
    $fax = preg_replace('#([\w]+://)([^\s()<>]+)#iS', '$2', htmlspecialchars($item->fax));
    $contact[] = JText::_('COM_DJCATALOG2_UP_FAX').': '.$item->fax.'';

  • Fixed it was error in default_map.php as follows
  • Is the fax field truncating the number of chars ? Anyway round this ?
  • edited August 30
    If I change the fax field to varcahr 255 in database will this cause a problem when I update component I dont want to lose data ?
  • Hi,

    It's hard to predict what will happen in future, but currently we are not planning to change definition of this column in any update.
Sign In or Register to comment.