The WorksForWeb Community Forums
Welcome to the WorksForWeb community forums. Here you can discuss WorksForWeb products with others and contribute to the rapidly growing WorksForWeb community. Please note that while WorksForWeb staff try to maintain presence on the forums, this is not the most reliable way to contact WorksForWeb staff. In case you require a timely response from WorksForWeb on an issue, please open a support ticket here. For pre-sales questions, please open a sales ticket here.

Welcome, Guest. Please login or register.
February 09, 2012, 12:17:34 AM

Login with username, password and session length
Search:     Advanced search
Added the iLister-related Boards

Rate My Site Boards Added

Merged iAuto and iRealty Support Forums together

Several new tips in the Tips and Tricks section
1,602 Posts in 623 Topics by 1,179 Members
Latest Member: bobsteam
* Home Help Search Login Register
+  The iAuto/iRealty/iLister Support Forum
|-+  iAuto and iRealty v.2.x - 3.x
| |-+  General iRealty Discussions
| | |-+  Edit Listings Page
« previous next »
Pages: [1] Print
Author Topic: Edit Listings Page  (Read 2974 times)
BrandFly
Newbie
*

Karma: 0
Posts: 16


View Profile
« on: July 13, 2007, 06:08:02 AM »

This is a great program but I'm kind of surprised how difficult it is to edit the way a listing looks. It seems like I have to edit the code in the db_search.php file. The css is easy, but I want to be able to customize the actual layout of the tables, etc. Is there a way to make it so I can actually see the layout in a .tpl file? It really should be as easy to edit a listing as it is to edit the main.tpl and index.tpl files. Any recommendations?
Logged

Dustin | BrandFly

iRealty V3.4
http://www.brandfly.com
Rodion
Guest
« Reply #1 on: July 13, 2007, 02:30:59 PM »

Dear BrandFly,
Unfortunately in current version of iAuto there are no templates for listing layout. You can use display form inteface in admin panel to modify listing fileds groups or order, but if you need to make an advanced customization of the listing layout, you'll need to modify the source code. I would recomend you to describe what exactly you want to do with listing details page, so that we could give you instruction on how to do it.

P.s. We plan to add listing layout templates to the next version of iAuto.
Logged
BrandFly
Newbie
*

Karma: 0
Posts: 16


View Profile
« Reply #2 on: July 14, 2007, 04:02:26 AM »

I'm actually using iRealty. Here's what I'm trying to do with the listing (I've attached a screenshot for reference of how it looks now):

1. What I want to do is move the Save, Print, Contact Seller, etc. (add_info.tpl) below the photo gallery thumbnails.
2. I want to remove the title "Pictures" that's appearing to the left of the photos. I know one way this can be done is by renaming the field from the admin, but I don't want anything there at all.

I'm hoping to have this figured out myself, but I think this would be beneficial for others to know. Thanks.
Logged

Dustin | BrandFly

iRealty V3.4
http://www.brandfly.com
BrandFly
Newbie
*

Karma: 0
Posts: 16


View Profile
« Reply #3 on: July 14, 2007, 05:10:19 AM »

Solution for #2 (How to remove form label 'pictures' in listings):

In /system/modules/classifieds/users/templates/yourtemplatename/form_display_item.tpl

Change line 1 {if $name ne ""} to {if $name ne "" && $name|lower|strip ne 'pictures'}
Logged

Dustin | BrandFly

iRealty V3.4
http://www.brandfly.com
Rodion
Guest
« Reply #4 on: July 16, 2007, 05:26:10 PM »

I see you've figgured out everything by yourself!
So, you right. To modify additional listing menu (Save, Print etc.) you need to change \system\modules\classifieds\user\templates\your_theme\add_info.tpl template file.
And to remove the "picture " title just put a blank space to the "Name Override" field of the display form.
Logged
BrandFly
Newbie
*

Karma: 0
Posts: 16


View Profile
« Reply #5 on: July 16, 2007, 11:34:09 PM »

I still need the solution to #1. I need to move the add_info.tpl to be below the photo gallery. I think I need to modify the db_search.php file but I can't seem to get it to work.
Logged

Dustin | BrandFly

iRealty V3.4
http://www.brandfly.com
highnote
Newbie
*

Karma: 1
Posts: 38


View Profile
« Reply #6 on: July 17, 2007, 06:04:59 AM »

Brandfly,

Unfortunately, it is not easy to insert something into the middle of the listing display because the display of the listing is (currently) performed in one atomic function call to html_display_form() where the sql query is converted to the html fairly efficiently.  [see known.php]   It appears, based on Rodian's comment, that they plan to de-couple the PHP and HTML for listing display forms in the next version by moving the HTML to a TPL file, which is a good thing.  It is not generally good practice to mix PHP and HTML in the same file.  Most of the iAuto/iRealty code has good separation, but this section remains.

However, you can move the additional info, the seller info and (if you are the listing owner) activate/deactivate/edit listing links to either the top or the bottom of the listing in the details display form:   

The html string which represents the listing display is "assembled" in a string variable called $result. 
Additionally, the additional info (print listing,  etc...) is "assembled" in the string variable called $modules

Since the $modules variable is inserted into $result, you can move the additional info either above or below the listing by changing where it gets inserted.

This is the section of code that displays the listing details.  Look for it in db_search.php - This is from iAuto, so iRealty may be different. I added comments with "lrg"

//-------------------- Original excerpt from db_search.php ------------------------------------------------------
$result .= '<table cellpadding=2 cellspacing=0 style="width:100%;"><tr><td valign=top width="'.(PIC_WIDTH + 10).'">';
get_display_data ($data_array,$arrr);
$data_array['m_id'] = $_REQUEST['id'];
$result .= html_display_form_($data_array, $template_processor); //lrg: this is the function that creates the html to display the listing from the sql query data
$result .= '</td><td valign=top style="padding-top:10">

';
$result .= $modules; // lrg: this is where the additional info gets inserted into the listing details page
// lrg: this section displays the Seller information
$result .= '

<div style="border:1px solid #e1e1e1;text-align:center;margin-bottom:2;background-color:#efefef;font-size:11">Seller                         Information</div><div class="userprofile">';
$result .= $GLOBALS['MODULE_MANAGER']->executeFunction('users','user_profile',array('userid'=>$listing['userid']));
$result .= '</div>';
$result .= '</td></tr></table>';
//-----------------------------------------------------

//-------------------- New code order to place the additional info and seller info above the listing information ------------
// lrg: this section displays the Seller information
$result .= '<td valign=top style="padding-top:0">'; // lrg changed padding to 0
$result .= '
<div style="border:1px solid #e1e1e1;text-align:center;margin-bottom:2;background-color:#efefef;font-size:11">Seller Information</div><div class="userprofile">';
$result .= $GLOBALS['MODULE_MANAGER']->executeFunction('users','user_profile',array('userid'=>$listing['userid']));
$result .= '</div>';
$result .= '</td>';
$result .= '<td>'; // lrg added to add column to place the additional info in same line as User Info
$result .= $modules; // lrg: this is where the additional info gets inserted into the listing details page
$result .= '</td>'; //lrg added to close initial <td>
$result .= '<table cellpadding=2 cellspacing=0 style="width:100%;">';
$result .= '<tr><td valign=top style="padding-top:5; BORDER-TOP: #cccccc 1px solid" width="'.(PIC_WIDTH + 10).'">';
get_display_data ($data_array,$arrr);
$data_array['m_id'] = $_REQUEST['id'];
$result .= html_display_form_($data_array, $template_processor);
$result .= '</td>';
$result .= '</tr></table>';
//------------------------------------------------------------------------

Note I added a border at the top of the database listing info and made the seller info and additional info on the same line and in two columns for aesthetics.  This is all html manipulation and perhaps you can modify it to suit your needs.

Replace this section of code in db_search.php, but save the original so you have something stable to go back to.

I hope this helps.
Regards,
Lou
Logged
BrandFly
Newbie
*

Karma: 0
Posts: 16


View Profile
« Reply #7 on: July 18, 2007, 12:34:24 AM »

Thanks a bunch Lou. This puts me in the right direction and helps me understand how the listing page is created. I can't wait until they put this into a .tpl file Smiley

Again, many thanks to Lou.
« Last Edit: July 18, 2007, 12:58:15 AM by BrandFly » Logged

Dustin | BrandFly

iRealty V3.4
http://www.brandfly.com
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Classified Software by Worksforweb Powered by SMF 1.1.8 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!