Webmastersite.net
Register Log In

Related Categories question

Comments on Related Categories question

Jez
Forum Regular

Usergroup: Customer
Joined: Jan 19, 2007

Total Topics: 32
Total Comments: 130
Jez
Posted Mar 31, 2008 - 3:21 AM:

Hi,

Is there an easy way of making all subcategories od individual main categories related to each other without having to go to each sub category and paste the category ID numbers in?

Thanks,

Jez.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Apr 01, 2008 - 12:11 PM:

Not that I can think of, except that you might be better served to just place a toplist of subcategories from the other category instead of using the related items option.
Jez
Forum Regular

Usergroup: Customer
Joined: Jan 19, 2007

Total Topics: 32
Total Comments: 130
Jez
Posted Apr 02, 2008 - 1:10 AM:

Ok, I will try that. Can you give any pointers? I haven't done anything with toplists.

Thanks Paul.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Apr 02, 2008 - 10:59 PM:

Use the toplist generator, and in the condition box type
parent=5
to show subcategories of category #5.
Jez
Forum Regular

Usergroup: Customer
Joined: Jan 19, 2007

Total Topics: 32
Total Comments: 130
Jez
Posted Apr 04, 2008 - 2:21 AM:

Paul,

I can't get this to work at all. I have no idea what I am doing wrong. I read the page scripts.webmastersite.net/w...uction-to-toplists-15.html and am none the wiser.

Thinking futher though, will what you have suggested work on all pages showing links in a sub cat such as this? http://www.accommodation-uk.net/aberdeenshire/aberdeen/ ? Will that page show all of the sub categories of the group that this page exists in? And also do the same for the other similar pages in the other cats? I am now not sure if I have explained very well.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Apr 04, 2008 - 7:41 PM:

Post what you're copying into your template and I'd comment, but I can't comment on nothing.

By group do you mean category type? In that case, parent=5 AND type='categorytypename'

If it's supposed to apply to all categories, replace 5 with {CATID}.
Jez
Forum Regular

Usergroup: Customer
Joined: Jan 19, 2007

Total Topics: 32
Total Comments: 130
Jez
Posted Apr 10, 2008 - 3:41 AM:

Paul,

This is what I am pasting. I have obviously missed some paramount info:

<!-- BEGIN TOPLIST 6 -->
<CONFIG>categories,name,5,ascending,,,,0,0,0,0,0,0,parent={CATID},0</CONFIG>
<a href="https://www.webmastersite.net/forums/{CATURL}"class="categoryname">{CATNAME}</a>
<!-- END TOPLIST 6 -->


This was after some seriously random mucking around. I haven't grasped this at all.

Hope you can help




Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Apr 12, 2008 - 11:35 AM:

You're typing in the wrong boxes. parent={CATID} is the filtering condition, it needs to be typed where the page asks for a filtering condition: http://www.webmastersite.net/screenshots/3038.jpg

Once you type in the correct box it'll be the 5th term in the generated config line. Not sure what box exactly you did type it in for it to end up as 15th.
Jez
Forum Regular

Usergroup: Customer
Joined: Jan 19, 2007

Total Topics: 32
Total Comments: 130
Jez
Posted Apr 14, 2008 - 12:05 PM:

I finally got there! Thanks Paul.

For my next question...

The solution is perfect for the sub-sub categories but how do I stop it showing on the sub categories - after all they both run off the same template don't they.

E.G: http://www.accommodation-uk.net/north-yorkshire/whitby/ - perfect

http://www.accommodation-uk.net/north-yorkshire/ - not as perfect

Jez
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
#10 - Quote - Permalink
Posted Apr 16, 2008 - 12:58 PM:

This should do it:

<IF {CATLEVELSDEEP} is greater than 1>
[toplist and any other content goes here]
</IF>
Jez
Forum Regular

Usergroup: Customer
Joined: Jan 19, 2007

Total Topics: 32
Total Comments: 130
Jez
#11 - Quote - Permalink
Posted Apr 16, 2008 - 1:26 PM:

I couldn't get that to work Paul

Here's what I tried:

<IF {CATLEVELSDEEP} is greater than 1>
[<p><strong>Other Categories in this county that may be of interest</strong></p>

<!-- BEGIN TOPLIST 8 -->

<CONFIG>categories,name,50,ascending,parent={CATPARENT},,,0,0,0,0,0,0,,0</CONFIG>
<a href="{CATURL}"class="categoryname">{CATNAME}</a><br >

<!-- END TOPLIST 8 -->
]</IF>

and

<IF {CATLEVELSDEEP} is greater than 1>
<p><strong>Other Categories in this county that may be of interest</strong></p>

<!-- BEGIN TOPLIST 8 -->

<CONFIG>categories,name,50,ascending,parent={CATPARENT},,,0,0,0,0,0,0,,0</CONFIG>
<a href="{CATURL}"class="categoryname">{CATNAME}</a><br >

<!-- END TOPLIST 8 -->
</IF>

(without square brackets)

I tried it without the Begin and End toplist 8 comments too, just in case. As well as outside the <p>text etc



What did I do wrong?

Jez
webflair
Forum Regular

Usergroup: Customer
Joined: Nov 27, 2006

Total Topics: 187
Total Comments: 465
#12 - Quote - Permalink
Posted Apr 17, 2008 - 5:02 PM:

What were the square brackets in your first example all about?

Anyway, lets try and sort this mess out for ya....

<IF {CATLEVELSDEEP} is greater than 1>
<p><strong>Other Categories in this county that may be of interest</strong></p>

<!-- BEGIN TOPLIST 8 -->

<CONFIG>categories,name,50,ascending,parent="{CATPARENT}",,,0,0,0,0,0,0,,0</CONFIG>
<a href="{CATURL}" class="categoryname">{CATNAME}</a><br >

<!-- END TOPLIST 8 -->
</IF>

Remember to make your toplist number unique on the page. two toplists with the same number wont work at all.

If the categories themselves (the ones where you want to display the toplist do not have sub categories of thier own, try...


<IF {CATNUMSUBCATS} is less than 1>
<p><strong>Other Categories in this county that may be of interest</strong></p>
<!-- BEGIN TOPLIST 8 -->

<CONFIG>categories,name,50,ascending,parent="{CATPARENT}",,,0,0,0,0,0,0,,0</CONFIG>
<a href="{CATURL}" class="categoryname">{CATNAME}</a><br >

<!-- END TOPLIST 8 -->
</IF>

Jez
Forum Regular

Usergroup: Customer
Joined: Jan 19, 2007

Total Topics: 32
Total Comments: 130
Jez
#13 - Quote - Permalink
Posted Apr 18, 2008 - 1:50 AM:

Thanks Jayweb, that works great. The first one didn't play but the second one which seems a better idea anyway works well. I appreciate it.


jayweb wrote:
What were the square brackets in your first example all about?


Lol, they were from Pauls example - just showing where the content was supposed to go - but I thought I better check :-)

Jez.
webflair
Forum Regular

Usergroup: Customer
Joined: Nov 27, 2006

Total Topics: 187
Total Comments: 465
#14 - Quote - Permalink
Posted Apr 18, 2008 - 7:46 AM:

This first one doesn't work because I think your category levels are not greater than 1. You could use that example if you changed <IF {CATLEVELSDEEP} is greater than 1> to <IF {CATLEVELSDEEP} is 1> or <IF {CATLEVELSDEEP} is less than 2>
webflair
Forum Regular

Usergroup: Customer
Joined: Nov 27, 2006

Total Topics: 187
Total Comments: 465
#15 - Quote - Permalink
Posted Apr 18, 2008 - 7:50 AM:

Be careful using any of these though because if you add new levels in your category structure they will stop working.

If I were you I would create a custom field for categories called showrelated and then edit every category you wish to show related categories in, and type the word "yes" into that field for each of those categories. You could then use...

<IF {CATSHOWRELATED} is yes>

and have full control over which categories show the toplist
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



Sorry, you don't have permission to post posts. Log in, or register if you haven't yet.