Go Back   Mosets Community > Mosets Templates > Kinabalu

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-25-2010, 03:46 AM
directtech directtech is offline
Mosets'd
 
Join Date: Aug 2007
Posts: 30
Default Core Field modification options?

Using the kinabalu template, I have the address items set to show in one row. However, I'd like to change it to show in two rows like this:

Address
City, State ZIP

Where can I make this change in the code?

Also, I want to change the detail listing so it doesn't display the email address, but instead just gives a text link like "Click to Email". I can do this in the default template, but don't see it in the kinabalu template. Thanks.
Reply With Quote
  #2  
Old 07-26-2010, 07:31 PM
dknight dknight is online now
Mosets Team - Lead Developer
 
Join Date: Dec 2004
Posts: 27,224
Default

You can make the changes wrt to the address here:

/components/com_mtree/templates/kinabalu/sub_listingDetails#.tpl.php

where # is the listing details style you are using.

Re: E-mail

You can override the output by editing the field type class at MT's back-end:

Mosets Tree > Custom Fields > Manage field types > E-mail (core)

under PHP Class Code field.
__________________
Lee
Lead Developer
Mosets.com - Quality Joomla! Solutions
Reply With Quote
  #3  
Old 07-27-2010, 05:13 AM
directtech directtech is offline
Mosets'd
 
Join Date: Aug 2007
Posts: 30
Default

I see the email field management area... but I don't know what to put in the PHP field to replace the visible email address with just the word "Email". Please give a little more direction for that one.

Regarding the address display, I was already in that file, but don't see what to modify to move the address display into two lines. Also, need to remove the , comma that displays in between the state and the zip. Don't see anywhere in this file to modify that either.

These kinabalu template files are a lot different from the m2 template files. More direction would be much appreciated. Thanks.
Reply With Quote
  #4  
Old 07-28-2010, 10:03 PM
dknight dknight is online now
Mosets Team - Lead Developer
 
Join Date: Dec 2004
Posts: 27,224
Default

Re: E-mail

Use these codes for E-mail's PHP Class Code:
PHP Code:
class mFieldType_coreemail extends mFieldType_email {
    var 
$name 'email';

    function 
getOutput() {
        
$email $this->getValue();
        
$html '';
        if(!empty(
$email)) {
            
$html .= '<script type="text/javascript"><!--' "\n" 'document.write(\'<a hr\'+\'ef="mai\'+\'lto\'+\':\'+\'';
            for(
$i=0;$i<strlen($email);$i++) {
                
$html .= '%'.dechex(ord(substr($email,$i,1)));
            }
            
$html .= '">';
            
$html .= 'Click to E-mail';
            
$html .= '<\/a>\');' "\n" '//--></script>';
        }
        return 
$html;
    }

__________________
Lee
Lead Developer
Mosets.com - Quality Joomla! Solutions
Reply With Quote
  #5  
Old 07-28-2010, 10:13 PM
dknight dknight is online now
Mosets Team - Lead Developer
 
Join Date: Dec 2004
Posts: 27,224
Default

Re: Address

Open up the listing details template file. Depending on the details style you are using, they maybe one of these:

/components/com_mtree/templates/kinabalu/sub_listingDetails.tpl.php
/components/com_mtree/templates/kinabalu/sub_listingDetailsStyle2.tpl.php
/components/com_mtree/templates/kinabalu/sub_listingDetailsStyle3.tpl.php
/components/com_mtree/templates/kinabalu/sub_listingDetailsStyle4.tpl.php
/components/com_mtree/templates/kinabalu/sub_listingDetailsStyle5.tpl.php
/components/com_mtree/templates/kinabalu/sub_listingDetailsStyle6.tpl.php
/components/com_mtree/templates/kinabalu/sub_listingDetailsStyle7.tpl.php

near line 31 - 44

Replace these codes:
PHP Code:
if( $this->config->getTemParam('displayAddressInOneRow','1') ) {
    
$this->fields->resetPointer();
    
$address_parts = array();
    
$address_displayed false;
    while( 
$this->fields->hasNext() ) {
        
$field $this->fields->getField();
        
$output $field->getOutput(1);
        if(
in_array($field->getId(),array(4,5,6,7,8)) && !empty($output)) {
            
$address_parts[] = $output;
        }
        
$this->fields->next();
    }
    if( 
count($address_parts) > ) { $address implode(', ',$address_parts); }

with the following codes:
PHP Code:
if( $this->config->getTemParam('displayAddressInOneRow','1') ) {
    
$this->fields->resetPointer();
    
$address_parts = array();
    
$address_displayed false;
    while( 
$this->fields->hasNext() ) {
        
$field $this->fields->getField();
        
$output $field->getOutput(1);
        if(
in_array($field->getId(),array(4,5,6,7,8)) && !empty($output)) {
            if(
$field->getId() == 4) {
                
$address .= $output '<br />';
            } elseif(
in_array($field->getId(),array(5,8))) {
                
$address .= ' '.$output;
            } else {
                
$address .= ', '.$output;
            }
        }
        
$this->fields->next();
    }

__________________
Lee
Lead Developer
Mosets.com - Quality Joomla! Solutions
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
custom field to core field nandoronsisvalle Discussions, Troubleshooting and Problems 0 05-28-2009 08:21 PM


All times are GMT +8. The time now is 12:42 PM.

Copyright © 2005-2010 Mosets Consulting

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.