Go Back   Mosets Community > Archives > Mosets Hot Property 1.0 > Discussions, Troubleshooting and Problems

 
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-17-2009, 10:16 PM
Stijn's Avatar
Stijn Stijn is offline
Mosets'd
 
Join Date: Oct 2006
Location: The Netherlands
Posts: 253
Default Other layout search results

Hello,

Is there a way to change the lay-out of the search result page.

Now it looks like this:

Property 1

Property 2

Property 3

I want it to look like this:

Property 1 | Property 2

Property 3 | Property 4

Hope someone can help me out

Regards,
Stijn
__________________
www.trouwportaal.nl
Joomla 2.5.x and Mosets Tree 3.0.x
  #2  
Old 12-21-2009, 07:16 AM
Padder Padder is offline
Mosets'd
 
Join Date: Jan 2007
Location: England
Posts: 14
Default

Hi,

In the file components/com_hotproperty/views/searches/tmpl/results.php, replace lines 82-96 from this:

Code:
<?php if ($this->properties) : ?>
	<ul class="results properties">
	<?php foreach ($this->properties as $property) : ?>
		<li class="property">
			<?php
			$this->property = $property;
			$this->headerLevel = 2;
			?>
			<?php echo $this->loadTemplate('property'); ?>
		</li>
	<?php endforeach; ?>
	</ul>
<?php else : ?>
	<p class="results properties empty"><?php echo JText::_('No result.'); ?></p>
<?php endif; ?>


to this:

Code:
<?php if ($this->properties) : ?>
	<ul class="results properties">
    <?php
		$cellcount = 3; //starts at 3 so first cell is left

		foreach ($this->properties as $property) :

   		if ($cellcount%2 == 1) :
			$cellclass=" left";
		else :
			$cellclass=" right";
		endif;
	?> 
		<li class="property<?php echo $cellclass; ?>">
			<?php
			$this->property = $property;
			$this->headerLevel = 2;
			?>
			<?php echo $this->loadTemplate('property'); ?>
		</li>
	<?php
   		$cellcount = $cellcount + 1;
		endforeach; ?>
	</ul>
<?php else : ?>
	<p class="results properties empty"><?php echo JText::_('No result.'); ?></p>
<?php endif; ?>
So you can now add css to float the li's left and right, and style them as you wish.


Or if you want to use a table to lay out the listings, then use something like this:

Code:
<?php if ($this->properties) : ?>
	<table width="100%">
    <?php
		$cellcount = 3; //starts at 3 so first cell is left
		foreach ($this->properties as $property) :
   		if ($cellcount%2 == 1) :
			//left cell
			$tbstart="<tr><td width='50%' class='tbcellleft'>";
			$tbend="</td>";
		else :
			//right cell
			$tbstart="<td width='50%' class='tbcellright'>";
			$tbend="</td></tr>";
		endif;
	?> 
	<?php
		echo $tbstart;
		$this->property = $property;
		$this->headerLevel = 2;
		echo $this->loadTemplate('property'); 
		echo $tbend;
   		$cellcount = $cellcount + 1;
		endforeach;
		if ($cellcount%2 == 1) { echo "<td></td></tr>"; }
		?>
	</table>
<?php else : ?>
	<p class="results properties empty"><?php echo JText::_('No result.'); ?></p>
<?php endif; ?>


The result inside the cell is then made up from the _summary template in properties folder.

I've tested the table version and it works, not sure about the li version but it should be ok. This is on HP1.0RC, but it should be the same principle for the beta versions, maybe in different files though. Hope that helps.

Last edited by Padder; 12-21-2009 at 07:20 AM.
 

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 01:57 AM.

Copyright © 2005-2010 Mosets Consulting

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