Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Display only if 'No. of links greater than x%

Quote Reply
Display only if 'No. of links greater than x%
Situation:
Category Structure:

Root-Category-One (8170)
....Sub-Category-One (50 links)
....Sub-Category-Two (7500 links)
....Sub-Category-Three (600 links)
....Sub-Category-Four (20 links)

Category-Two (507)
....Sub-Category-One (5 links)
....Sub-Category-Two (2 links)
....Sub-Category-Three (500 links)

What I am trying to do:
on Category page (category.html) page, I want to only display categories that has 11% or more of total links under their parent category.

-------------------
In subcategory.html I understand that I can use something like
<%if Direct_Links >= '50' %>
however that can't really work for different categories, as trying to display categories only with a minimum of x% links of Parent category.

Is there any if/elseif type condition that could help with this?


Thank you.

Vishal
-------------------------------------------------------
Quote Reply
Re: [VishalT] Display only if 'No. of links greater than x% In reply to
It seems like for now I will end up using the method
<%if Direct_Links >= '50' %>
As it seems to solve the requirement & hopefully make things simpler for now.

Vishal
-------------------------------------------------------
Quote Reply
Re: [VishalT] Display only if 'No. of links greater than x% In reply to
I have solved this inside nph-build.cgi with something like:

Code:
$PLG->dispatch('create_category', \&_build_category, GT::SQL::Condition->new('Number_of_Links', '>=', '0'
));
Quote Reply
Re: [Robert] Display only if 'No. of links greater than x% In reply to
Hi Robert,

I don't know enough perl to feel confident about editing any core files.. :(

Vishal
-------------------------------------------------------