Support Forums

How to display categories in the left column

This is a discussion on How to display categories in the left column within the Modules / Plugins / Modifications forums, part of the Developer Forums category; Hi, A quick newbie question (I'm loving 68classifieds so far!) - has anyone placed the categories in the left hand ...


Go Back   68 Classifieds Forums > Developer Forums > Modules / Plugins / Modifications

Reply
 
Thread Tools Display Modes
Old 05-27-2008, 06:59 AM   #1
Junior Member
 
Join Date: May 2008
Posts: 9
Rep Power: 0
spark is on a distinguished road
Default How to display categories in the left column

Hi,

A quick newbie question (I'm loving 68classifieds so far!) - has anyone placed the categories in the left hand column? I'd like to do this so that the categories are always visible for the user. Ideally I'm wanting to change the code into a seo friendly <ul><li> setup, with a possibility or nesting the sub categories and displaying them too if required.

Has anyone of you already done such a thing? Is there an example of the code that I could look at just so I'm not reinventing the wheel?

Many thanks,

Konrad
spark is offline   Reply With Quote
Old 05-27-2008, 02:27 PM   #2
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,315
Rep Power: 125
Eric Barnes is a jewel in the rough
Default

Hi,

You should be able to use this:
Code:
{categories_parent}
<ul>
{foreach from=$pcat item=entry}
<li>{$entry.link}</li>
{/foreach}
</ul>
Please note that this will only pull the parent categories.
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 05-28-2008, 09:26 AM   #3
Junior Member
 
Join Date: May 2008
Posts: 9
Rep Power: 0
spark is on a distinguished road
Thumbs up

Thanks, that did the trick! I have now been trying based on this code to place the subcategories in there as well but have been getting error messages (I'm not a php coder!).

I would like the sub categories only to appear nested in the main categories menu when on the actual parent page - is this possible?

Thanks!

Konrad
spark is offline   Reply With Quote
Old 05-28-2008, 09:39 AM   #4
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,315
Rep Power: 125
Eric Barnes is a jewel in the rough
Default

I am really not sure how difficult it would be. However the file this pulls from is includes/classes/smarty/plugins/function.categories_parent.php

You may want to look in that to see how it is generated.
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 05-28-2008, 10:18 AM   #5
Junior Member
 
Join Date: May 2008
Posts: 9
Rep Power: 0
spark is on a distinguished road
Default

Thanks for your help - however, this si way beyond my php capabilities - I think I'll leave it for now but of course if anyone else wants to look at it then that would be really appreciated!

Thanks again,

Konrad
spark is offline   Reply With Quote
Old 06-27-2008, 08:10 AM   #6
Senior Member
 
Join Date: Apr 2007
Posts: 100
Rep Power: 14
jj30 is on a distinguished road
Default

I was interested in getting the main categories on the left column,

The code Eric has supplied, where does it actually need placing?

What other changes do I have to make to accomomdate this change.

Any help would be most appreciated.

Thanks
jj30 is offline   Reply With Quote
Old 06-27-2008, 08:37 AM   #7
Junior Member
 
Join Date: May 2008
Posts: 9
Rep Power: 0
spark is on a distinguished road
Default

Hi JJ,

Go into templates/default/layout.tpl and find this bit of code:
Code:
		<div class="clear"></div>
		<table width="100%">
			<tr>
				<td valign="top" width="200">
					<!-- // Right Side // -->
						<div id="sidebar">
      							<h1>{$smarty.const.LANG_MEMBER_NAVIGATION}</h1>					<div class="left-box">
You'll want to place the new code within the sidebar tags, either above or below the existing navigation. In my case, I placed it above so it looks like this (I've called it 'Browse by Location'):
Code:
		<div class="clear"></div>
		<table width="100%">
			<tr>
				<td valign="top" width="200">
					<!-- // Right Side // -->
						<div id="sidebar">
                        <h1>Browse by Location</h1>
                        <div class="left-box">
                            {categories_parent}
								<ul class="sidemenu">
                                	{foreach from=$pcat item=entry}
										<li>{$entry.link}</li>
									{/foreach}
								</ul>
                            </div>
							<h1>{$smarty.const.LANG_MEMBER_NAVIGATION}</h1>
							<div class="left-box">
Hope this helps!

Konrad
spark is offline   Reply With Quote
Old 06-27-2008, 02:33 PM   #8
Senior Member
 
Join Date: Apr 2007
Posts: 100
Rep Power: 14
jj30 is on a distinguished road
Default

Many thanks for the reply

I will try it.

Is your site up and ready ?

Cheers
jj30 is offline   Reply With Quote
Old 06-29-2008, 01:15 PM   #9
Junior Member
 
Join Date: May 2008
Posts: 9
Rep Power: 0
spark is on a distinguished road
Default

It is uploaded but certainly not yet ready - it'll still take me a few months as I'm having to squeeze it in with work for my paying customers...

http://www.largeholidayhome.co.uk/index.php

There is a holding page shielding the 68classifieds pages so make sure you have the index.php version.

Konrad
spark is offline   Reply With Quote
Old 08-04-2008, 03:41 AM   #10
Member
 
Join Date: Jun 2008
Posts: 69
Rep Power: 8
fendter is on a distinguished road
Default

inserting the code in the layout.tpl file per Spark's instructions worked fine in Version 4.04. I upgraded to 4.06 and repeated the same steps and get error messages when I click on the "place an ad" link.

First I thought I had missed something, but went through the code line by line. I finally uploaded my old layout.tpl file (the one I had created in 4.04) and I got the same error message when clicking on the "place an ad" link.

I finally went back to the the layout.tpl file that came with the 4.06 upgrade. Has anybody encountered the same issue? I only have three categories and would like to have them displayed on the left hand side menu if at all possible.
fendter is offline   Reply With Quote
Reply

Tags
list , menu , navigation

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Alphebetical category display teg Technical Support 6 03-12-2008 09:41 AM
Making a Left Hand Column goose Templates, HTML, CSS, and Design Help 1 09-26-2007 06:49 PM
Right column dphibb v3.1 Questions & Support 1 07-17-2007 09:35 AM
Categories displayed in left column...??? Netpower v3.1 Modules & Modifications 4 07-06-2007 03:03 PM


All times are GMT -4. The time now is 06:00 AM.


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