Support Forums

Old 02-20-2007, 08:46 AM   #1
68 Evangelist & Developer
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 1,605
Rep Power: 47
Mike-N-Tosh is just really niceMike-N-Tosh is just really nice
Default Different template for categories?

I'm sure that this is possible, but instead of having to re-invent the wheel I thought that I'd throw this out there.

Has anyone made different templates for specific categories?

I have two top level categories that I have added a number of extra fields to (Vehicles and Real Estate). I hate the default look of having all of those extra categories just listed one after another in the view listing.

I would assume that there must be a way to tell 68 classifieds something like:

If listing type=10 (example ID)
vehicle.tpl.php
elseif listing type=14 (second example ID)
realestate.tpl.php
else viewlisting.tpl.php
endif

Obviously, I'm not a programmer

Also, in order to make the specific templates for those categories, how do I call the specific extra fields separately to include them on the page where I would like to have them placed. The standard viewlisting.tpl.php file simply makes one call with a for each statement for ALL the extra fields.

Thanks in advance for any help, suggestions, etc.

-Mike
IndianaPC.org
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified)
Sandbox (v3.1.10, v4.0.9, 4.1.3)
Visit My blog for tips, tricks, tutorials, reviews for 68 Classifieds as well as my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Old 02-20-2007, 10:28 AM   #2
68 Classifieds Staff
 
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,075
Rep Power: 117
Eric Barnes is a jewel in the rough
Default

Hi Mike,

I believe Juven14 created a module for this at one time but I am not sure if it still around. You may want to try and searching these forums for it. I believe it was built for v3.0.

Also we do get this question a lot and for v4 I will see if I can't figure out a way of doing this.
__________________
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 | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 02-20-2007, 11:41 AM   #3
Old Timer
 
BABBSELA's Avatar
 
Join Date: Oct 2006
Location: Denver, Colorado
Posts: 68
Rep Power: 13
BABBSELA is on a distinguished road
Default

This is something I would like to to, too. I'd like to have additional fields for automobile ads, so I'm guessing I need to add tables to the db, an alternate template so they can fill in those fields if they choose the auto category, and an alternate template for displaying all the fields in the ad.

BTW: I didn't find this topic in 3.0. I may have used the wrong search terms. I'll look again and post here if I find anything.
__________________
Thanks,
Barbara

v 3.1.5 Developer

Get great deals in Denver and across the web, at Garage Sale Show.com
BABBSELA is offline   Reply With Quote
Old 02-20-2007, 12:22 PM   #4
Moderator
 
juven14's Avatar
 
Join Date: Mar 2006
Location: Texas
Posts: 2,213
Rep Power: 61
juven14 is a jewel in the rough
Default

I only made different templates for the store pages. The user could develop a template or the admin and the admin set it in the store table.

The way I would probably do it would be to set a field for the category like the category image, and then just have it determine the template from there.
__________________
John Snyder
PHP Developer
juven14 is offline   Reply With Quote
Old 02-20-2007, 12:45 PM   #5
68 Evangelist & Developer
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 1,605
Rep Power: 47
Mike-N-Tosh is just really niceMike-N-Tosh is just really nice
Default

Quote:
Originally Posted by BABBSELA View Post
This is something I would like to to, too. I'd like to have additional fields for automobile ads, so I'm guessing I need to add tables to the db, an alternate template so they can fill in those fields if they choose the auto category, and an alternate template for displaying all the fields in the ad.
Actually (rereading my original post), I made the mistake of saying that I hate the look of it listing all of the "catgories" one right after another.

What it should have said is, ...listing all of the "extra fields" one after another. Making the "extra fields" is easy and is already built in to 68classifieds. (Admin/extra fields and attach to categories).

What I'm trying to say is that when a user either browses or searches, they then get a list of ads (listings). If they click on the photo or the "more" link, then it shows the ad in the "viewlisting.tpl.php" template which shows it within the layout template.

I can modify the "viewlisting.tpl.php" template which I have already done, BUT the "extra fields" are simply one call to see if there are extra fields and if yes, then display those too, one right after another. Also any changes in the viewlistin.tpl.php file is universal for ALL categories.

What I'm saying is two fold. I want to have more than one viewlisting.tpl.php. In the viewlisting.php (where the link is going when the user is in browse or already searched), I want it to see if the category is one of the custom categories for which there is a separate template and if there is show the listing using that template instead of the default.

I'm sure that it would work, but my biggest issue to resolve is how to get the individual "extra fields" in the custom layouts.

-Mike
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified)
Sandbox (v3.1.10, v4.0.9, 4.1.3)
Visit My blog for tips, tricks, tutorials, reviews for 68 Classifieds as well as my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Old 02-20-2007, 01:07 PM   #6
Moderator
 
juven14's Avatar
 
Join Date: Mar 2006
Location: Texas
Posts: 2,213
Rep Power: 61
juven14 is a jewel in the rough
Default

All you need to do is in viewlisting.php determine the section and then put an if or switch around it to display the viewlistings body template. I don't have access right now to my files but it would be something like this:

PHP Code:
switch ( $section )
{
     case 
'2' :
          
$class_tpl->assign'body''custom.tpl.php');
     break;
     case 
'3' :
           
$class_tpl->assign'body''othercustom.tpl.php');
      break;
     default :
           
$class_tpl->assign'body''viewlistings.tpl.php');
      break;

Now for the extra fields you can call them directly like:

{$extra.something} -- I can't remember exactly, but I've seen a thread lHotch made addressing this very issue.
__________________
John Snyder
PHP Developer
juven14 is offline   Reply With Quote
Old 02-20-2007, 01:24 PM   #7
68 Evangelist & Developer
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 1,605
Rep Power: 47
Mike-N-Tosh is just really niceMike-N-Tosh is just really nice
Thumbs up

John,

Thanks, that's exactly what I was looking for. I'll search for the extra field calls that you referred too.

-Mike
When there's a will...
There's upset relatives!!!
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified)
Sandbox (v3.1.10, v4.0.9, 4.1.3)
Visit My blog for tips, tricks, tutorials, reviews for 68 Classifieds as well as my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Old 02-20-2007, 01:28 PM   #8
Old Timer
 
BABBSELA's Avatar
 
Join Date: Oct 2006
Location: Denver, Colorado
Posts: 68
Rep Power: 13
BABBSELA is on a distinguished road
Default

Adding extra fields in the administration panel adds them for all categories. Would the extra fields for the custom template need to be entered into the db manually?

Your answer will take care of displaying the custom template with the extra fields, but to give the user the option to enter text into extra fields specific to that custom template, won't we have to put in a switch in the checkout process - like maybe in step1.tpl.php? Or am I looking in the wrong place?
__________________
Thanks,
Barbara

v 3.1.5 Developer

Get great deals in Denver and across the web, at Garage Sale Show.com
BABBSELA is offline   Reply With Quote
Old 02-20-2007, 01:30 PM   #9
68 Classifieds Staff
 
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,075
Rep Power: 117
Eric Barnes is a jewel in the rough
Default

Quote:
Adding extra fields in the administration panel adds them for all categories. Would the extra fields for the custom template need to be entered into the db manually?
No you can bind extra fields to specific categories. So autos can have different fields than dogs.
__________________
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 | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 02-20-2007, 01:45 PM   #10
Old Timer
 
BABBSELA's Avatar
 
Join Date: Oct 2006
Location: Denver, Colorado
Posts: 68
Rep Power: 13
BABBSELA is on a distinguished road
Default

Uh, okay. Duh. I should have looked at the extra fields before posting.

[head: meet desk]
__________________
Thanks,
Barbara

v 3.1.5 Developer

Get great deals in Denver and across the web, at Garage Sale Show.com
BABBSELA is offline   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 Templates and You. Posted BY Lhotch Eric Barnes HTML, CSS, and Design Help 13 10-02-2007 08:06 AM
Free Template? FlyingBee HTML, CSS, and Design Help 4 12-08-2006 10:17 AM
Sukaw Horse-Green Template Syssh v3.1 Questions & Support 3 12-03-2006 12:47 PM
HTML Template brian-bear HTML, CSS, and Design Help 7 10-12-2006 05:21 AM
Dreamweaver Template in 68classifieds sporthorsebreeder HTML, CSS, and Design Help 3 04-23-2006 10:34 AM


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


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