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

Display all Categories, SubCategories, and their Links on homepage

Quote Reply
Display all Categories, SubCategories, and their Links on homepage
Is there a global/mod/plugin to show the entire site listings on one page (homepage)? v. 3.2.x - something like this:

HOMEPAGE:
Code:

- AUTOMOTIVES
- KINDS
- bmw
- mercedes
- jeeb
- more ...
- DEALERS
- carmax
- Aarego
- Schomachar
- more ...

- EDUCATION
- UNIVERSITIES
- mit
- hvt
- mst
- more ...

Last edited by:

Mark2: Feb 23, 2016, 12:10 PM
Quote Reply
Re: [Mark2] Display all Categories, SubCategories, and their Links on homepage In reply to
Hi,

So you want a full list of the categories, in the order of their depth?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Display all Categories, SubCategories, and their Links on homepage In reply to
Not just the categories, subcategories, but also links under the main category, and links under the subcategory...
Is like:
- yahoo subcategory or
- browser tree expanded but on one page, or
- like any Category Page (is like a second home page) where it shows subcategories, but links are showing underneath each subcategory and underneath sub-subcategories... with no indentations/margins, padding ...

(something like this but no indentations ...).
Code:
- AUTOMOTIVES
- SUB1 SUB2
- SUB1-1 - link in SUB 2
. link1-1 - link in SUB 2
. link1-1 - link in SUB 2
. link1-1 - link in SUB 2
. .... - link in SUB 2
. more.. (go to SUB1-1 page) . more.. (go to SUB2 page)
- SUB1-2
. link1-2
. link1-2
. link1-2
. ....
. more.. (go to SUB1-2 page)
- SUB1-3
. link in SUB1
. link in SUB1
. link in SUB1
. link in SUB1
. .....
. more .. (go to SUB1 page)
- SUB3
- SUB3-1
. link3-1
. link3-1
. link3-1
. ....
. more.. (go to SUB2-2 page)
- SUB3-2
. link3-2
. link3-2
. link3-2
. ....
. more.. (to SUB2-3 page)
- SUB4-3
. link in SUB3
. link in SUB3
. link in SUB3
. link in SUB3
. ....
. more.. (go to SUB2 page)
. link in AUTOMOTIVES 1
. link in AUTOMOTIVES 2
. link in AUTOMOTIVES 3
. ....
. more.. (go to Automotives page)

- EDUCATION
- SUB1
. link1-1
. link1-1
. link1-1
. ....
. more.. (go to SUB1 page)
. link in EDUCATION
. link in EDUCATION
. link in EDUCATION
. link in EDUCATION
. .....
. more .. (go to EDUCATION page)
Quote Reply
Re: [Mark2] Display all Categories, SubCategories, and their Links on homepage In reply to
Mmmm ok- its quite tricky. Let me see if I can come up with something

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Mark2] Display all Categories, SubCategories, and their Links on homepage In reply to
Hi,

Ok, so that was pretty tricky =) It only goes down to 3 category levels deep. Simply download the attached .pm file, and upload it into the ./admin/Plugins folder. Thenn, in your template call:

Code:
<%Plugins::CategoryList::handle()%>

<%--<%DUMP all_cat_loop%>--%>

<%loop all_cat_loop%>
<ul>
<li><b>Cat:</b> <a href="<%URL%>"><%Name%></a>
<%if sub_cat_loop1.length%>
<ul>
<%loop sub_cat_loop1%>
<li><b>Cat:</b><a href="<%URL%>"><%Name%></a>
<%if sub_cat_loop2.length%>
<ul>
<%loop sub_cat_loop2%>
<li><b>Cat:</b> <a href="<%URL%>"><%Name%></a>
<%if links_loop2.length%>
<ul>
<%loop links_loop2%>
<li>LINK: <%Title%></li>
<%endloop%>
</ul>
<%endif%>
</li>
<%endloop%>
</ul>
<%endif%>
<%if links_loop2.length%>
<ul>
<%loop links_loop2%>
<li>LINK: <%Title%></li>
<%endloop%>
</ul>
<%endif%>
</li>
<%endloop%>
</ul>
<%endif%>
<%if links_loop1.length%>
<ul>
<%loop links_loop1%>
<li>LINK: <%Title%></li>
<%endloop%>
</ul>
<%endif%>
</li>
</ul>
<%endloop%>

If you are in a category already, and only want to show sub-cats for that, then you can also pass in an ID:

Code:
<%Plugins::CategoryList::handle($ID)%>

It won't look super pretty with the current template code - but I will leave you to do the visual layout stuff Whistle

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Display all Categories, SubCategories, and their Links on homepage In reply to
Thank you so much Andy... always good to be around ...
I haven't tried it yet, but wondering if this is intended to work on the home page?
Quote Reply
Re: [Mark2] Display all Categories, SubCategories, and their Links on homepage In reply to
Hi,

NP.

For the homepage, just use:

Code:
<%Plugins::CategoryList::handle()%>

and on cat pages:

Code:
<%Plugins::CategoryList::handle($ID)%>

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Display all Categories, SubCategories, and their Links on homepage In reply to
Hey,

Wouldnt that be the same as your sitemap global available here I guess.
The one where you control how many lines in a column, and fonts, and everything within the global.

Dunno who wrote it, or if its on here. But that does the same thing.

JC
Quote Reply
Re: [Gorospe] Display all Categories, SubCategories, and their Links on homepage In reply to
Mmm not sure - I don't remember writing it, but its possible someone else wrote something back in the day Whistle I did write a SiteMap plugin, but that works very differently (as its outputting just a list of data, and not in order with child links below it, etc)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Display all Categories, SubCategories, and their Links on homepage In reply to
Hi Andy, it looks quite nice, just couple of issues:

1. Split to columns is not there. Means, can this liner listing be split to columns in the same fashion as the Categories on Home Page (using just the Categories - not the subcategories).

2. The link titles are not hyperlinked, can same link.html functions be used in it... like (image in front of the link, pop, new, ...etc.)

All at home page..
Otherwise, the main functionality is working but as you suggested with some magic touches.

Regards..
Mark
Quote Reply
Re: [Mark2] Display all Categories, SubCategories, and their Links on homepage In reply to
Hi,

Quote:
1. Split to columns is not there. Means, can this liner listing be split to columns in the same fashion as the Categories on Home Page (using just the Categories - not the subcategories).

Splitting into columns is a bit more tricky :) I'd have to do that as a paid job (already spent a good hour on the above code)

Quote:
2. The link titles are not hyperlinked, can same link.html functions be used in it... like (image in front of the link, pop, new, ...etc.)

If you edit this part:

Code:
while (my $link = $sth->fetchrow_hashref) {
push @links, $link;
}

To:

Code:
while (my $link = $sth->fetchrow_hashref) {
$link = Links::SiteHTML::tags('link',$link);
push @links, $link;
}

...then that should give you access to all the tags you want :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Display all Categories, SubCategories, and their Links on homepage In reply to
Thanks again Andy.. sure that works for me. Let me finish the core stuff/design and when I start in integration I'll ask for split.
BTW - I've added:
Code:
" . $CFG->{build_index}"
at the end of category/sub category building (three places)
Code:
... "/".....
in order to display index.php in the URL (cause I am using rewrite rules based on index.php ... stuck with it).

Thanks again..
Mark
Quote Reply
Re: [Mark2] Display all Categories, SubCategories, and their Links on homepage In reply to
Hi,

No worries Angelic

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!