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

 
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-23-2010, 04:42 PM
williamdswanepoel williamdswanepoel is offline
Mosets'd
 
Join Date: Aug 2010
Posts: 28
Default How to create agent drop down box with agent module ?

I want to change the agent module and create a drop down box. I have changed the code from:

Code:
<ul class="menu<?php echo $params->get('class_sfx'); ?>">
<?php foreach ($agents as $agent) : ?>
	<li<?php if (JRequest::getString('option') == 'com_hotproperty' && JRequest::getString('view') == 'agents' && JRequest::getString('id') == $agent->id) echo ' class="active"'; ?>>
		<a href="<?php echo JRoute::_(MosetsRoute::getLink('hotproperty', array('view' => 'agents', 'layout' => 'properties', 'id' => $agent->id))); ?>">
			<?php if ($params->get('show_thumbnail')) : ?>
				<?php echo MosetsHTML::_('hotproperty.image.photo', 'agent', @$agent->photo); ?>
			<?php endif; ?>
			<span><?php echo htmlspecialchars($agent->name, ENT_QUOTES, 'UTF-8'); ?></span>
		</a>
	</li>
<?php endforeach; ?>
</ul>
to:

Code:
<select class="menu<?php echo $params->get('class_sfx'); ?>">
<?php foreach ($agents as $agent) : ?>
	<option<?php if (JRequest::getString('option') == 'com_hotproperty' && JRequest::getString('view') == 'agents' && JRequest::getString('id') == $agent->id) echo ' class="active"'; ?>>
		<a href="<?php echo JRoute::_(MosetsRoute::getLink('hotproperty', array('view' => 'agents', 'layout' => 'properties', 'id' => $agent->id))); ?>">
			<?php if ($params->get('show_thumbnail')) : ?>
				<?php echo MosetsHTML::_('hotproperty.image.photo', 'agent', @$agent->photo); ?>
			<?php endif; ?>
			<span><?php echo htmlspecialchars($agent->name, ENT_QUOTES, 'UTF-8'); ?></span>
		</a>
	</option>
<?php endforeach; ?>
</select>
1. Now I get a drop down box, but the fields are not sorted, how do I sort them?

2. I would like to insert the first field as -Select Agent- ?

3. I would like the drop down box to go to the agents profile once I click on one of the fields in the drop down box without having to press a search button after wards?
  #2  
Old 09-23-2010, 10:39 PM
gray gray is offline
Mosets'd
 
Join Date: Apr 2006
Posts: 901
Default

1. you have to take the array $agents, to see what it contains (with print_r for example) and to re-create it with the sorting you'd like to have. sort() or other array functions could be used.

2. before foreach try to add
<option value="-1">-Select Agent-</option>

3. JavaScript should be used for this task.
__________________
4HP: Slideshow Module New!
www.topcomhomes.com
 

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
I think I am going to go insane over no Agent Menu paulemurray Discussions, Troubleshooting and Problems 2 03-15-2009 06:43 PM


All times are GMT +8. The time now is 08:40 AM.

Copyright © 2005-2010 Mosets Consulting

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