Adding a Heading to the Featured Listings

This is a discussion on Adding a Heading to the Featured Listings within the HTML, CSS, and Design Help forums, part of the General category; Hello I want to include a heading for the Featured Listings that show on my home page in the same ...


Go Back   68 Classifieds Forums > General > HTML, CSS, and Design Help

 
LinkBack Thread Tools Display Modes
  #1  
Old 04-04-2006, 11:32 PM
Senior Member
 
Join Date: Apr 2006
Posts: 126
Rep Power: 14
Default Adding a Heading to the Featured Listings

Hello
I want to include a heading for the Featured Listings that show on my home page in the same way that the Browse Categories section has a heading on the home page.
Can anyone tell me how to do this?
Thanks for any help.
Hugh

Reply With Quote
  #2  
Old 04-04-2006, 11:45 PM
Moderator
 
Join Date: Mar 2006
Posts: 3,735
Rep Power: 91
Default

I beleive the featured listings plugin builds its own table, the plugin is in includes/template/plugins and is called function.featured_listings_horizontal.php.

At approx line 98 you have the line that assignst the start table tag and the values passed to the function from the template to the variable called $output and it looks like this.

PHP Code:
$output "<table " $table_attr.">\n"
I havent tested it, but just under that and before any of the table rows are created you could add another line with your table header info and append it to the current value of $output, so you would have something like this....

PHP Code:
$output "<table " $table_attr.">\n";
$output.="<tr><th>Your table title here</th></tr>"
You may need to specify colspan in the table header tag as well but that should get you started.

Another, perhaps easier method would be in layout.tpl.php, just above where the function is called. Simply create a new table with your header above the function and get ride of the line break above where the function is currently called. This may give you the desired result, youd have to try it and see.
__________________
Larry.
(Please note: I am not a 68C employee. I am a customer and volunteer who helps with questions where I can and the forums spam free)

Set your site apart from the competition with one of my modules......
Google Map Module | You Tube Module | Google Calendar Module | Event Calendar Module

68 Classifieds Important Links
Customer Area | Issue Tracker | Knowledge Base | User Manuals
Reply With Quote
  #3  
Old 04-05-2006, 07:23 AM
Senior Member
 
Join Date: Apr 2006
Posts: 126
Rep Power: 14
Default

Hello Lhotch
Thanks for your reply.
I added add another line with the table header info and appended it to the current value of $output and this did the trick. Well almost.
The background of the header does not go all the way across as it does in the Browse Categories section.
Can you tell me how to extend the background of the heading all the way across the table?
Sorry about the basic question but I am new to PHP.
Cheers
Hugh
Reply With Quote
  #4  
Old 04-05-2006, 10:05 AM
Moderator
 
Join Date: Mar 2006
Posts: 3,735
Rep Power: 91
Default

Quote:
Originally Posted by sporthorsebreeder
Hello Lhotch
Thanks for your reply.
I added add another line with the table header info and appended it to the current value of $output and this did the trick. Well almost.
The background of the header does not go all the way across as it does in the Browse Categories section.
Can you tell me how to extend the background of the heading all the way across the table?
Sorry about the basic question but I am new to PHP.
Cheers
Hugh
As I mentioned above, you will likely have to add "colspan=x" behind the opening table header tag.

The number you specify to span should equal how many table data cells you have. So if your table has 3 cells then do this....

HTML Code:
$output.="<tr><th colspan="3">Your table title here</th></tr>"; 
__________________
Larry.
(Please note: I am not a 68C employee. I am a customer and volunteer who helps with questions where I can and the forums spam free)

Set your site apart from the competition with one of my modules......
Google Map Module | You Tube Module | Google Calendar Module | Event Calendar Module

68 Classifieds Important Links
Customer Area | Issue Tracker | Knowledge Base | User Manuals
Reply With Quote
  #5  
Old 04-05-2006, 10:59 AM
Senior Member
 
Join Date: Apr 2006
Posts: 126
Rep Power: 14
Default

Quote:
Originally Posted by Lhotch
The number you specify to span should equal how many table data cells you have. So if your table has 3 cells then do this....

HTML Code:
$output.="<tr><th colspan="3">Your table title here</th></tr>"; 
Hello Larry
I am not sure where to look to find out how many cells the table has. I looked in the function.feature_listings_horizontal.php file and found that the table had 4 cols and 3 rows so I guessed 7. I entered the code
$output.="<tr><th colspan="7">Featured Listings</th></tr>"; in line 99 and I received the following error when I tried to view my home page.

Parse error: parse error, unexpected T_LNUMBER in C:\Websites\tbdiaries\includes\template\plugins\fu nction.feature_listings_horizontal.php on line 99
Any idea where I am going wrong?
Cheers
Hugh
Reply With Quote
  #6  
Old 04-05-2006, 11:11 AM
68 Classifieds Staff
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 4,323
Rep Power: 99
Default

Hugh,

How about this? Change the function file back to the way it was. Next open the layout.tpl.php file and locate the {function_feature_listings}

Change it to this:
HTML Code:
<table class="tborder">
<tr>
<th>Featured Listings</th>
</tr>
<tr>
<td>
{function_feature_listings original code here} 
</td>
</tr>
</table>
__________________
Eric Barnes
68 Classifieds Developer
Please do not send me a private message asking for support. Instead use these open forums or our ticket system.

Customer Area | Issue Tracker | Documentation | 68C Mods | Submit a Ticket | Twitter
Reply With Quote
  #7  
Old 04-05-2006, 11:44 AM
Moderator
 
Join Date: Mar 2006
Posts: 3,735
Rep Power: 91
Default

Quote:
Originally Posted by sporthorsebreeder
Hello Larry
I am not sure where to look to find out how many cells the table has. I looked in the function.feature_listings_horizontal.php file and found that the table had 4 cols and 3 rows so I guessed 7. I entered the code
$output.="<tr><th colspan="7">Featured Listings</th></tr>"; in line 99 and I received the following error when I tried to view my home page.

Parse error: parse error, unexpected T_LNUMBER in C:\Websites\tbdiaries\includes\template\plugins\fu nction.feature_listings_horizontal.php on line 99
Any idea where I am going wrong?
Cheers
Hugh
Erics method will probably be cleaner but in the line above I forgot to escape the double quotes around the number 3, like this..

PHP Code:
$output.="<tr><th colspan=\"3\">Your table title here</th></tr>"
__________________
Larry.
(Please note: I am not a 68C employee. I am a customer and volunteer who helps with questions where I can and the forums spam free)

Set your site apart from the competition with one of my modules......
Google Map Module | You Tube Module | Google Calendar Module | Event Calendar Module

68 Classifieds Important Links
Customer Area | Issue Tracker | Knowledge Base | User Manuals
Reply With Quote
  #8  
Old 04-05-2006, 01:14 PM
Senior Member
 
Join Date: Apr 2006
Posts: 126
Rep Power: 14
Default

My thanks to Larry and Eric
That's it working now
I used Larry's method. It worked fine with escaping the double quotes around the number 7
$output.="<tr><th colspan=\"7\">Featured Listings</th></tr>";
Thanks for all your help.
Cheers Lads
Hugh
Reply With Quote
  #9  
Old 04-05-2006, 01:18 PM
68 Classifieds Staff
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 4,323
Rep Power: 99
Default

Glad you got it working.
__________________
Eric Barnes
68 Classifieds Developer
Please do not send me a private message asking for support. Instead use these open forums or our ticket system.

Customer Area | Issue Tracker | Documentation | 68C Mods | Submit a Ticket | Twitter
Reply With Quote
  #10  
Old 05-31-2006, 10:54 PM
Junior Member
 
Join Date: May 2006
Posts: 28
Rep Power: 11
Default

Hey Ya'll -
This worked for me except I found this code in home.tpl.php - not layout.tpl.php

Quote:
Originally Posted by suzkaw
Hugh,

How about this? Change the function file back to the way it was. Next open the layout.tpl.php file and locate the {function_feature_listings}

Change it to this:
HTML Code:
<table class="tborder">
<tr>
<th>Featured Listings</th>
</tr>
<tr>
<td>
{function_feature_listings original code here} 
</td>
</tr>
</table>
Reply With Quote

Bookmarks

Thread Tools
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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Smarty Variables for Featured Listings? bgordon v3.1 Questions & Support 7 09-12-2006 01:50 PM
Featured Listings versatility v3.1 Questions & Support 1 08-09-2006 12:43 PM
Adding a heading to the Featured Listings sporthorsebreeder v3.1 Questions & Support 2 07-21-2006 01:04 PM
Adding a heading to the Featured Listings sporthorsebreeder v3.0 Questions & Support 1 07-21-2006 12:49 PM
adding link to featured listings text NJHomeGuide v3.0 Questions & Support 0 05-07-2006 04:21 PM


All times are GMT -4. The time now is 05:42 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22