Go Back   Mosets Community > Mosets Tree 3.x > Discussions, Troubleshooting & Problems

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-18-2013, 03:55 PM
Lenfitz Lenfitz is offline
Mosets'd
 
Join Date: May 2008
Location: Australia
Posts: 298
Default Show address related fields in one row

Hi Lee,

"Think" I found another bug,

If "Show address related fields in one row" selected is YES in kinabalu admin backend then some of the CORE fields do not show up in the details listings page.

Here is what the same listing looks with the fields in one row switched YES.

EG: Show address related fields in one row" selected is YES, The state and country fields do not show up in the details page.

Code:
Listing Details

Website: www.baseplan.com
"Missing state core field", "Missing country core field"
Hits: 161
Votes: 0
When: Show address related fields in one row" selected is NO then the state and country fields do show up in the details page.

Code:
Listing Details

Website: www.baseplan.com
State: NSW Correct
Country: Australia Correct
Hits: 161
Votes: 0
The state and country fields should display regardless of in a row or not.


Note * There is an address and city core field which is empty in this particular listing, but state and country fields are not empty. It appears to effect listings which have an empty prior fields like address, city.

If a listing has fields address, city, state, country populated then these listing are fine and un-affected.

Ideally the state and country field should show regardless of whether the fields are displayed in a row or single fields. For the record I have these fields to display in both summary and detail page views.
__________________
Member of the Australian and USA Joomla! Translation Team

Last edited by Lenfitz; 01-18-2013 at 04:18 PM.
Reply With Quote
  #2  
Old 02-03-2013, 04:38 AM
Lenfitz Lenfitz is offline
Mosets'd
 
Join Date: May 2008
Location: Australia
Posts: 298
Default

Any update for this Lee?

I have to release my new 2.5 website very shortly and need this sorted ASAP before I can go live.

Cheers
__________________
Member of the Australian and USA Joomla! Translation Team
Reply With Quote
  #3  
Old 02-04-2013, 07:07 AM
tradewise tradewise is offline
Senior Member
 
Join Date: Feb 2006
Location: Hervey Bay Qld Australia
Posts: 576
Default

I can see that the code from version 2.2.6 to 3.0.3 that outputs address in sub_listingSummary.tpl.php has completely changed. I haven't tried this yet but one part of a line in the codes stands out that may be wrong...

in 2.2.6 which works in that version reads $output = $field->getOutput(2);
but in 3.0.3 reads $output = $field->getOutput(1);

From memory reading in the knowledge base somewhere that getOutput(1) is for Details whilst getOutput(2) is summary. So, in 3.0.3 shouldn't it be $output = $field->getOutput(2); ???

Regards Steve
Developer of PaymentsPlus
Reply With Quote
  #4  
Old 02-04-2013, 10:50 AM
Lenfitz Lenfitz is offline
Mosets'd
 
Join Date: May 2008
Location: Australia
Posts: 298
Default

The summary view is fine.

It is the details page which is not showing the state and country field.

I've done some testing and find that if the address field is empty it will not display the rest of fields that are populated.

I have a tonne of listings which do not have the address field populated but do have the state and country fields.

So in short this works when the fields are fully populated - address>city>state>country

but won't when just state>country populated but address field empty.

The issue is with the code in the sub_listingDetailsStyleX.tpl file but haven't been able to nut out the source of the issue.

Although thanks for tip. Might help to do some comparisons between summary.tpl and details.tpl.
__________________
Member of the Australian and USA Joomla! Translation Team
Reply With Quote
  #5  
Old 02-04-2013, 11:48 PM
tradewise tradewise is offline
Senior Member
 
Join Date: Feb 2006
Location: Hervey Bay Qld Australia
Posts: 576
Default

A possible work around could be in mtree.php in the savelisting section to add some if statements to check if address fields are empty and if empty insert a dash "-" so the field saves with a value. Then for current listings run an sql in phpmyadmin to add the dash for all empty values. Whilst not a permanent solution it might get you out of trouble for now.

Regards Steve
Developer of PaymentsPlus
Reply With Quote
  #6  
Old 02-05-2013, 10:45 PM
Lenfitz Lenfitz is offline
Mosets'd
 
Join Date: May 2008
Location: Australia
Posts: 298
Default

Quote:
Originally Posted by tradewise View Post
A possible work around could be in mtree.php in the savelisting section to add some if statements to check if address fields are empty and if empty insert a dash "-" so the field saves with a value. Then for current listings run an sql in phpmyadmin to add the dash for all empty values. Whilst not a permanent solution it might get you out of trouble for now.

Regards Steve
Developer of PaymentsPlus
Thought about throwing something in the address field as well via DB but think it might not be a great option. For new listings the fields are required so no problems with those just the many listings which already don't have the full address.

Code:
// This condition ensure that fields listed in array() are skipped
			!in_array($field->getName(),array('link_name','link_desc'))
			&&
			(
				(
					$this->config->getTemParam('displayAddressInOneRow','1') == 1
					&& 
					!in_array($field->getId(),array(5,6,7,8)) 
				)
				||
				$this->config->getTemParam('displayAddressInOneRow','1') == 0
			)
This above code is the culprit. Appears to be overiding the following code. By removing the above fields 5,6,7,8 from the array the fields appear but so do the lines underneath each field which displays 4 extra blank lines.

Code:
// Fields in array() are always displayed regardless of its value.
		in_array($field->getName(),array('link_featured'))
	) {
		if( $field_count % $number_of_columns == 0 ) {
			echo '<div class="row0">';
			$need_div_closure = true;
		}
		
		echo '<div class="fieldRow'.(($field_count % $number_of_columns == ($number_of_columns -1))?' lastFieldRow':'').'" style="width:'.floor(98/intval($number_of_columns)).'%">';
		
		if($this->config->getTemParam('displayAddressInOneRow','1') && in_array($field->getId(),array(4,5,6,7,8)) && $address_field = $this->fields->getFieldById(4)) {
			if( $address_displayed == false ) {
				echo '<div class="caption">';
				if($address_field->hasCaption()) {
					echo $address_field->getCaption();
				}
				echo '</div>';
				echo '<div class="output">';
				echo $address_field->getDisplayPrefixText(); 
				echo $address;
				echo $address_field->getDisplaySuffixText(); 
				echo '</div>';
				$address_displayed = true;
			}
		} else {
			echo '<div class="caption">';
			// echo $field->getId();
			if($field->hasCaption()) {
				echo $field->getCaption();
			}
			echo '</div>';
			echo '<div class="output">';
			switch($field->getFieldType()) {
				case 'mfile':
					echo $field->getDisplayPrefixText(); 
					echo '<p class="mbutton">';
					echo $field->getOutput(1);
					echo '<p>';
					echo $field->getDisplaySuffixText(); 
					break;

				case ( $field->getFieldType() == 'coreprice' && $field->getValue() == 0 ):
					echo $field->getOutput(1);
					break;

				default:
					echo $field->getDisplayPrefixText(); 
					echo $field->getOutput(1);
					echo $field->getDisplaySuffixText(); 
			}
			echo '</div>';
		}
		echo '</div>';
So basically unless address field 4 is populated fields 5,6,7,8 don't show.

Was hoping 3.0.4 would have a fix but alas no joy.
__________________
Member of the Australian and USA Joomla! Translation Team
Reply With Quote
  #7  
Old 10-18-2014, 01:01 AM
sharon sharon is offline
Mosets'd
 
Join Date: Dec 2012
Posts: 6
Default No street address means no city, state, zip in Details view

Has anyone found a way to fix this problem when choosing the one-line option so street, city, state and zip are one line? Many of my members don't want their street address included. I've tried adding a few words to the Default Value but that doesn't help.

I don't care about Summary View, just Details.
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


All times are GMT +8. The time now is 02:35 AM.

Copyright © 2005-2010 Mosets Consulting

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