View Full Version : hide category on the main page..!
jahangirafzal
03-10-2006, 09:51 PM
Hi,
is it possible to hide any specific category on the main page of the directory. e.g
i want to show only
Cat 1 -> sub Cat
Cat 2 -> sub Cat
Cat 3 -> sub Cat
Cat 5 -> sub Cat
but i dont wanna show "Cat 4 -> sub Cat" on the main page... i want to show it as a special link some where on the page
weird .................... :?
thanks
JA
Content visible to registered users only.
should do it.
SyncMaster
08-26-2006, 07:39 AM
I am trying to achieve the same thing but with no luck. Anon.. can you please explain the code you posted above as to where am going to use it? main.tpl or any php file?
I am trying to hide two main categories along with their sub cats on the home page and display them somewhere else on the home page. Can you please point me to the right direction?
Thanks
if you don't want those categories rendered along with teh rest of them like the script normally does, in the main.tpl just use an {if} clause.
1 .find out what those two category ID's are.
2. {if $category.ID ne 11111 or $category.ID ne 22222} <--111 and 222 are the category numbers of those two cats you want to hide.
...Normal code here for main cats and sub cats
{/if}
it'll just skip those two particular ID's
encase your the normal code thats already in there and within the {foreach}
{foreach}
{if}
...normal code
{/if}
{/foreach}
follow?
SyncMaster
08-26-2006, 09:54 AM
Thanks anon for your help. Unfortunately it did'nt work for me. Considering we have the default "spring break" template and the categories I want to hide are 72 and 126, here is what i did:
Content visible to registered users only.
I am not sure what I am missing here but it still displays all the categories I have. Please help :)
my appologies.
use: $cat.ID
not: $category.ID
orrrrr maybe i am high on crack tonight :p
ok triple edit:
i just did it on my site
where your <TD> starts right before you start displaying your categories...
<td align="left" valign="top">
{if $cat.ID ne 72 and $cat.ID ne 126}
maincats blah blah
subcats blah blah
{/if}
</td>
SyncMaster
08-26-2006, 10:32 AM
I can now see the first three main categories along with their sub cats. Looks like the first row is displayed and the rest of them were skipped :(
I have a total of 12 main categories out of which only 3 were displayed. I did it the same way u asked me to. Can you please share ur main.tpl file? :(
Edit: It worked perfect now. I moved the if statement before the <td> and right after the {foreach} and banggggg...... Thanks a bunch anon.. u r a champ :P
SyncMaster
08-26-2006, 10:43 AM
Now the second part. How can I show those two categories along with subcats somewhere else on the home page?.. Should I copy the entire ctaegory display code and paste it where i want it to display and then change the if condition or something? :)
well... you can do it two ways...
reuse that same code above, and make it $cat.ID eq 72 or $cat.ID eq 126
or you can write some php to grab the info for those two specific cats.
hehe... php = you're on your own. :)
(btw, is this gonna be for a new template? if yes do i get a sneak preview :P)
SyncMaster
08-26-2006, 11:22 AM
Great!!.... I'll try this ...
It isn’t a new template. I am trying to convert my "designers directory" to phpLD but before I purchase a license I just want to make sure I can customize it the way it currently is. Take a look at http://www.web-designers-directory.org . See we have two regional categories below the main categories. I want to display them exactly the same way. I designed a new skin for this but it isn’t complete yet. Will let you know once I got it working. Thanks for your help buddy :)
SyncMaster
08-26-2006, 02:33 PM
Allright... am stuck again :o
How can I display the subcats in three columns ? :confused:
e.g. the way "international web designers" are displayed at http://www.web-designers-directory.org/ where "international web designers" is the main category and all the countries are subcats.... Please help :)
Set your col count to 3 in the admin and use the
and look into the iteration mod for smarty
SyncMaster
08-26-2006, 03:15 PM
anon.. the col count is already set to 3 and I can see the main categories are displayed in three columns. I want to display the subcats of a specific cmain ctagory in 3 columns. I did'nt get your " and look into the iteration mod for smarty" part
i know what to do and what needs to be done, but the technicalities of it, to explain it, are just to complicated for the non-modder. =/
SyncMaster
08-26-2006, 07:43 PM
I somehow managed to get it work with a little bit of PHP code.
Just incase somone is trying the same thing, here is my code:
Content visible to registered users only. Thanks to anon for helping me out ... :)
vBulletin® v3.8.0, Copyright ©2000-2012, Jelsoft Enterprises Ltd.