Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
hide Child forums
Avatar
Funeral
Member
sp_UserOfflineSmall Offline
Nov 13, 2015 - 7:13 pm

Hello i was wondering how to hide the child forums of subforums on the main forum index?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Nov 13, 2015 - 7:42 pm

Apologies is this isn't clear enough... I am on plane at 38000 with limited access... We  can clarify in AM if needed.

In simple press most of the display is done via template functions in your sp theme you are using...

So in this case you simply need to remove the template function that displays the subgroup info...

So in your sp theme template file sp_forumvew.php, if you look in there,  you will see a function call like

https://simple-press.com/docum.....xsubforums

if you remove that line the subgroup info will not be shown..

As Always, we strongly recommend you make a child theme or a custom theme before making any changes to keep from losing changes on updates 

Hope that is clear... If not, we can clean it up in AM...

Avatar
Funeral
Member
sp_UserOfflineSmall Offline
Nov 13, 2015 - 8:06 pm

i dont have that exact call function in spForumViewDesktop.php

# Set the Forum
# ----------------------------------------------------------------------
if (sp_this_forum()):

# Are there sub forums to display
if (sp_has_subforums()) :

# Start the 'SubForumHeader' section
# ----------------------------------------------------------------------
sp_SectionStart('tagClass=spForumViewSection', 'subForum');

sp_SectionStart('tagClass=spForumViewHeader', 'header');

sp_ForumHeaderIcon('tagId=spSubForumHeaderIcon&tagClass=spHeaderIcon spLeft');
sp_ForumHeaderName('tagId=spSubForumHeaderName&tagClass=spHeaderName');
sp_SubForumHeaderDescription('', __sp('Sub Forums'));
sp_InsertBreak();

sp_SectionEnd('', 'header');
sp_InsertBreak('spacer=5px');

sp_SectionStart('tagClass=spForumSubforumContainer', 'subforumlist');

while (sp_loop_subforums()) : sp_the_subforum() ; if(sp_is_child_subforum()) :

# Start the 'subforum' section - note the special subform call above
# ----------------------------------------------------------------------
sp_SectionStart('tagClass=spGroupForumSection', 'subForum');

# Column 1 of the forum row
# ----------------------------------------------------------------------
sp_ColumnStart('tagClass=spIconColumnSection spLeft&width=0&height=0px');
sp_SubForumIndexIcon('tagClass=spRowIcon spLeft');
sp_ColumnEnd();
sp_InsertBreak('tagClass=groupBreak');

# Column 2 of the forum row
# ----------------------------------------------------------------------
sp_ColumnStart('tagClass=spColumnSection spLeft&width=49%&height=0px');
sp_SubForumIndexName('tagClass=spRowName', __sp('Browse topics in %NAME%'));
sp_InsertBreak('direction=left');
sp_SubForumIndexDescription('tagClass=spRowDescription');
sp_SubForumIndexPageLinks('tagClass=spInRowPageLinks spLeft', __sp('Jump to page %PAGE% of topics'));
sp_ColumnEnd();
sp_InsertBreak('tagClass=groupBreak');

# Column 3 of the forum row
# ----------------------------------------------------------------------
sp_ColumnStart('tagClass=spColumnSection spLeft&width=39%&height=0px');
sp_SubForumIndexTopicCount('tagClass=spInRowCount spLeft', __sp('Topics:'));
sp_SubForumIndexPostCount('tagClass=spInRowCount spLeft', '  '.__sp('Posts:'));
sp_InsertBreak('direction=left');
sp_SubForumIndexLastPost('tagClass=spInRowPostLink&order=UTLD&nicedate=0&date=1&time=1&stackdate=0&itemBreak= - ', __sp('Last Post'), __sp('No Topics'));
sp_ColumnEnd();
sp_InsertBreak();

# Column 4 of the forum row
# ----------------------------------------------------------------------
sp_ColumnStart('tagClass=spColumnSection spRight&width=2%&height=0px');
sp_SubForumIndexLockIcon('tagClass=spIcon spRight', __sp('This forum is locked'));
sp_SubForumIndexAddIcon('tagClass=spIcon spRight', __sp('Add new topic in this forum'));
sp_SubForumIndexPostsIcon('tagClass=spIcon spRight&icon=sp_GroupOpenDark.png&popup=1', __sp('This forum has unread posts in %COUNT% topic(s)'));
sp_ColumnEnd();
sp_InsertBreak();
sp_SubForumIndexInlinePosts();
sp_InsertBreak();

sp_SectionEnd('', 'subForum');

# Subforums of subforum
# ----------------------------------------------------------------------
sp_ForumHeaderSubForums('unreadIcon=sp_SubForumUnreadIcon.png', __sp('Sub-Forums'), __sp('Browse topics in %NAME%'));

endif ; endwhile;

sp_SectionEnd('', 'subforumlist');

sp_SectionEnd('', 'forum');

endif;
# End of subforum section

thats the subforum section. i dont mind having the subforums on the main forumview but its the sub forums of the sub forums on the main forum view i would like to hide.

Avatar
Ike
Sawtry, UK
Member
Free Members
sp_UserOfflineSmall Offline
Nov 14, 2015 - 4:03 am

Hey Funeral,

For this you would need to add the argument 'allNested' which by default is set to 1 displaying sub forum children. So add it but set to 0 i.e:

sp_ForumIndexSubForums('unreadIcon=sp_SubForumUnreadIcon.png&allNested=0', __sp('Sub-Forums:'), __sp('Browse topics in %NAME%'));
Avatar
Funeral
Member
sp_UserOfflineSmall Offline
Nov 14, 2015 - 11:02 am

Do i put that in my spForumviewdesktop.php? i tried adding it right below where it said subforum section starts but it didnt do anything

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Nov 14, 2015 - 11:58 am

Lets step back...  think there is confusion on what you want to do...  Ike and I have been talking about group view, but it appears you mean forum view? 

so if you want to remove the subforums from the forum view pages, then you would just remove the code you posted...  that controls the display...  EXCEPT, leave the first line there

if (sp_this_forum()):

so delete what you posted from below that line to the end of what you posted... and you wont have subforums listed on the forum page...

and as before, do that in a child theme or custom theme...

Avatar
Funeral
Member
sp_UserOfflineSmall Offline
Nov 16, 2015 - 6:37 pm

i deleted what you suggested,didnt seem to do anything

Avatar
Ike
Sawtry, UK
Member
Free Members
sp_UserOfflineSmall Offline
Nov 16, 2015 - 6:53 pm

Can we just confirm where you want to remove sub forum children. Are you talking about the very first page you see when you first access your forum - i.e the root page - Group View? This was my assumption as you said the 'main forum index' which does as standard display sub forum children.. Easily confusing terminology!

We should refer to each view by it's template name to avoid confusion.

So if we are indeed talking about Group View, then you need to make my change to spGroupViewDesktop.php.

And it doesn't need to be added below anything, the only change is the argument 'allNested' inside the function 'sp_ForumIndexSubForums'.

Locate the function 'sp_ForumIndexSubForums' and add the 'allNested=0' argument so the function then looks like:

sp_ForumIndexSubForums('unreadIcon=sp_SubForumUnreadIcon.png&allNested=0', __sp('Sub-Forums:'), __sp('Browse topics in %NAME%'));

If I'm wrong, please could you clarify using the template name to reference which view you want to change?

Group View = the first view you see - groups of forums

Forum View = second view, inside one of these forums - a list of topics

Topic View = viewing a topic

Sorry if that sounds patronising but it's best to make sure we're all talking about the same thing!

Avatar
Funeral
Member
sp_UserOfflineSmall Offline
Nov 16, 2015 - 6:56 pm

Terminology had me all messed up haha! that worked thanks a ton!

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Nov 16, 2015 - 9:17 pm

no worries! glad we got there... 

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17361
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625