Photo of the Month

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Big Categories
PostPosted: Sat Apr 07, 2012 21:46 
Offline
Assistant Site Manager

Joined: Sat May 23, 2009 09:18
Posts: 1819
Location: Lochaber
We currently have two very large categories - Bridges (1336 pages) and Junctions (2868 pages). The Bridges are currently also largely (although not completely) categorised under Arch, Suspension etc, and I would like in the longer term to do something similar with Junctions. As far as bridges are concerned, I think that the majority not in a sub-cat have [[Cat:Br..]] at the bottom anyway, so would it be possible to change the Bridges Infobox to read [[Category:All Bridges]] in place of [[Category:Bridges]] - the former could then be a Hidden Cat, and the latter would only (hopefully) have un-categorised bridges in.
Ditto, although maybe at a later date, for Junctions?

_________________
Rob.
My mission is to travel every road and visit every town, village and hamlet in the British Isles.
I don't like thinking about how badly I am doing.


Top
 Profile  
 
 Post subject: Re: Big Categories
PostPosted: Sat Apr 07, 2012 21:59 
Offline
Member
User avatar

Joined: Tue Feb 12, 2002 21:39
Posts: 12548
Location: Wolverhampton, Staffordshire
rileyrob wrote:
We currently have two very large categories - Bridges (1336 pages) and Junctions (2868 pages).


Roads is currently 8,320 pages!

Quote:
The Bridges are currently also largely (although not completely) categorised under Arch, Suspension etc, and I would like in the longer term to do something similar with Junctions. As far as bridges are concerned, I think that the majority not in a sub-cat have [[Cat:Br..]] at the bottom anyway, so would it be possible to change the Bridges Infobox to read [[Category:All Bridges]] in place of [[Category:Bridges]] - the former could then be a Hidden Cat, and the latter would only (hopefully) have un-categorised bridges in.
Ditto, although maybe at a later date, for Junctions?


We could do something like that, yeah. What is possible is to auto-generate the categories (type=suspension or similar), but the big problem with that is that it involves extreme accuracy with the typing. I could probably do something with it so that if it didn't fit the exact wording it would fall through to a catch-all category.

_________________
Steven


Top
 Profile  
 
 Post subject: Re: Big Categories
PostPosted: Sat Apr 07, 2012 23:36 
Offline
Member

Joined: Sun Nov 28, 2004 23:28
Posts: 4694
Steven wrote:
We could do something like that, yeah. What is possible is to auto-generate the categories (type=suspension or similar), but the big problem with that is that it involves extreme accuracy with the typing. I could probably do something with it so that if it didn't fit the exact wording it would fall through to a catch-all category.


Whack this where you would like the type to be displayed... it'll run a switch on whatever is given in the type= parameter...

Code:
{{#switch: {{{type}}}
 | suspension          = Suspension Bridge <includeonly>[[Category:Suspension Bridges]]</includeonly>
 | arch                = Arch Bridge <includeonly>[[Category:Arch Bridges]]</includeonly>
 | falling apart       = Falling Apart Bridge <includeonly>[[Category:Falling Apart Bridges]]</includeonly>
 | hammersmith flyover = Screwed Bridges <includeonly>[[Category:Screwed Bridges]]</includeonly>
...
 | default <span style="font-size:8pt"><span style="color:red;">'''Error:'''</span> Invalid bridge type specified</span><includeonly>[[Category:Pages with errors]]</includeonly>
}}


"|type=suspension" would display "Suspension Bridge" and put it in the suspension bridges category
"|type=suspenssion" would display "Error: Invalid bridge type specified"

I implemented a similar thing on the type field of the route boxes.


Top
 Profile  
 
 Post subject: Re: Big Categories
PostPosted: Sat Apr 07, 2012 23:52 
Offline
Member
User avatar

Joined: Sat May 31, 2003 13:25
Posts: 8953
Location: Amersham
you'll want to change the parameter from type to bridgetype as type is already in use.

_________________
"Give a man a fish and you feed him for a day. Give him a fish every day of his life and you've created a loyal constituent."


Top
 Profile  
 
 Post subject: Re: Big Categories
PostPosted: Mon Apr 09, 2012 09:05 
Offline
Member
User avatar

Joined: Tue Feb 12, 2002 21:39
Posts: 12548
Location: Wolverhampton, Staffordshire
Just a thought - we can do this, but we still need the massive "bridge" category, as that's how the navbox works!

We can, however, add the "subcategories" quite happily - like "Roads" has "Motorways" for example

_________________
Steven


Top
 Profile  
 
 Post subject: Re: Big Categories
PostPosted: Mon Apr 09, 2012 15:27 
Offline
Assistant Site Manager

Joined: Sat May 23, 2009 09:18
Posts: 1819
Location: Lochaber
Yes, I see what you mean. However, apart from trashing the job queue, is there any reason why the navbox couldn't cope with Category:All Bridges instead though? The reason being that the Bridge subcategories, bridge type* pages, uncategorized bridges and so on are all in Category:Bridges, making it very hard to see the wood for the trees.
* I appreciate that these could go in a Bridge Type sub-cat, but that could still get lost on page 2 of the big list.

_________________
Rob.
My mission is to travel every road and visit every town, village and hamlet in the British Isles.
I don't like thinking about how badly I am doing.


Top
 Profile  
 
 Post subject: Re: Big Categories
PostPosted: Mon Apr 09, 2012 15:47 
Offline
Member
User avatar

Joined: Tue Feb 12, 2002 21:39
Posts: 12548
Location: Wolverhampton, Staffordshire
rileyrob wrote:
Yes, I see what you mean. However, apart from trashing the job queue, is there any reason why the navbox couldn't cope with Category:All Bridges instead though? The reason being that the Bridge subcategories, bridge type* pages, uncategorized bridges and so on are all in Category:Bridges, making it very hard to see the wood for the trees.
* I appreciate that these could go in a Bridge Type sub-cat, but that could still get lost on page 2 of the big list.


Yes, I think we could do that. There would be a period of time where things wouldn't work properly as we'd have to do the Navbox change at one point, and the Bridges infobox at another, or we'll overwhelm the server.

_________________
Steven


Top
 Profile  
 
 Post subject: Re: Big Categories
PostPosted: Mon Apr 09, 2012 15:52 
Offline
Member
User avatar

Joined: Tue Aug 31, 2004 16:06
Posts: 6797
Location: Manchester
Just a word of caution. Try not to fiddle with template code too much. A seemingly innocuous template edit has been known to cause very heavy load on the server for days at a time.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group