[MOD] Categories in header like Digg (useful if you have subcategories)

Register an Account
Reply
 
Thread Tools Display Modes
  #21 (permalink)  
Old 06-28-2007, 01:46 AM
Casual Pligger
 
Join Date: Mar 2007
Posts: 48
How do you add/remove new sub-categories from this?
Reply With Quote
  #22 (permalink)  
Old 06-28-2007, 04:05 AM
New Pligger
 
Join Date: Nov 2006
Posts: 15
Quote:
Originally Posted by ryanshyper View Post
How do you add/remove new sub-categories from this?
Go to your admin, category management, and on the bottom left click the ? question mark bubble. The trick is to align the category name up exactly with the cat you want to be the parent.
Reply With Quote
  #23 (permalink)  
Old 06-28-2007, 04:12 AM
dollars5's Avatar
Pligg Donor
 
Join Date: Dec 2006
Location: India
Posts: 1,960
Category management has to be done from Admin panel.
Reply With Quote
  #24 (permalink)  
Old 06-29-2007, 02:54 AM
Casual Pligger
 
Join Date: Mar 2007
Posts: 48
Never even knew that was there - thanks guys! Much appreciated.
Reply With Quote
  #25 (permalink)  
Old 07-14-2007, 11:02 AM
New Pligger
 
Join Date: May 2007
Posts: 6
just want show my appreciate here. very useful mod.
I'll use it.
thanks for your hard work
Reply With Quote
  #26 (permalink)  
Old 07-14-2007, 05:39 PM
Adaman's Avatar
Constant Pligger/Designer
Pligg Version: v9.8.2
Pligg Template: Custom
 
Join Date: Jan 2007
Location: Scotland
Posts: 101
Hi Dollar,

Great MoD i have been plying around with it on my test server but i am having a slight headache

The categories will only direct to the published section, when you browse the unpublished page the header categories still link to the published page. ie, index.php and not upcoming.php.

Has anyone else experienced this as i imagine that when viewing unpublished pages the header categories should be pointing to the unpublished categories.

Any help appreciated guys.

Cheers

Ads
Reply With Quote
  #27 (permalink)  
Old 07-15-2007, 01:30 AM
New Pligger
 
Join Date: Jul 2007
Posts: 15
Quote:
Originally Posted by Adaman View Post
Hi Dollar,

Great MoD i have been plying around with it on my test server but i am having a slight headache

The categories will only direct to the published section, when you browse the unpublished page the header categories still link to the published page. ie, index.php and not upcoming.php.

Has anyone else experienced this as i imagine that when viewing unpublished pages the header categories should be pointing to the unpublished categories.

Any help appreciated guys.

Cheers

Ads
Many thanks to Dollars5 for the code.
However, like Adaman I am having the same difficulties.
I would request Dollars5 to help us out.
Thanks again
Reply With Quote
  #28 (permalink)  
Old 07-15-2007, 08:13 AM
New Pligger
 
Join Date: Jul 2007
Posts: 15
@Adaman

Adaman, I have managed to slightly modify the Code written by Dollars5 to view the Categories & Subcategories by clicking the Published and Upcoming tabs.

The code can be placed in the header.tpl page

Hope this helps.

Cheers

The Code is as follows:


{if $pagename eq 'published' || $pagename eq 'upcoming'}
{******Get the parent category******}
{assign var=requested_cat value=$request_category}

{* if story page - set the story's category to this *}
{if $pagename eq 'story'}

{assign var=requested_cat value='sub'}
{/if}

{assign var=mainCatStr value=''}
{assign var=parentCat value=-1}
{section name=thecat loop=$cat_array}
{if $cat_array[thecat].safename eq $requested_cat}
{if $cat_array[thecat].parent neq 0}
{assign var=parentCat value=$cat_array[thecat].parent}
{assign var=mainCatStr value=$cat_array[$parentCat].safename}
{else}
{assign var=parentCat value=$cat_array[thecat].auto_id}
{assign var=mainCatStr value=$cat_array[thecat].safename}
{/if}
{/if}
{/section}

{********* Displaying the Main categories *******************}
<div id="headbar" style="border-bottom:1px solid #ccc;padding-bottom:4px">
{section name=thecat loop=$cat_array}

{if $cat_array[thecat].parent eq 0}
{if $cat_array[thecat].safename eq $requested_cat || $cat_array[thecat].auto_id eq $parentCat}
{if $pagename eq "published"}
<a href="{$URL_maincategory, $cat_array[thecat].safename}" style="padding-bottom:5px;">{$cat_array[thecat].name}</a>
{else}
<a href="{$URL_queuedcategory, $cat_array[thecat].safename}" style="padding-bottom:5px;">{$cat_array[thecat].name}</a>
{/if}
{elseif $requested_cat eq "" && $cat_array[thecat].auto_id eq 0}
{if $pagename eq "published"}
<a href="{$URL_maincategory, $cat_array[thecat].safename}" style="padding-bottom:5px;">{$cat_array[thecat].name}</a>
{else}
<a href="{$URL_queuedcategory, $cat_array[thecat].safename}" style="padding-bottom:5px;">{$cat_array[thecat].name}</a>
{/if}
{else}
{if $pagename eq "published"}
<a href="{$URL_maincategory, $cat_array[thecat].safename}" style="padding-bottom:5px;">{$cat_array[thecat].name}</a>
{else}
<a href="{$URL_queuedcategory, $cat_array[thecat].safename}" style="padding-bottom:5px;">{$cat_array[thecat].name}</a>
{/if}
{/if}
{/if}
{/section}</div>
<br/>
{********* Displaying the Sub categories *******************}
<span>
{if $parentCat gt 0}
<div id= "headbar" style="border-bottom:1px solid #ccc;padding-bottom:4px">
{if $requested_cat eq $mainCatStr}
{if $pagename eq "published"}
<a href="{$URL_maincategory, $cat_array[thecat].safename}" style="padding-bottom:5px;">{$cat_array[thecat].name}</a>
{else}
<a href="{$URL_queuedcategory, $cat_array[thecat].safename}" style="padding-bottom:5px;">{$cat_array[thecat].name}</a>
{/if}

{else}

{if $pagename eq "published"}
<a href="{$URL_maincategory, $cat_array[thecat].safename}" style="padding-bottom:5px;">{$cat_array[thecat].name}</a>
{else}
<a href="{$URL_queuedcategory, $cat_array[thecat].safename}" style="padding-bottom:5px;">{$cat_array[thecat].name}</a>
{/if}
{/if}
{section name=thecat loop=$cat_array}
{if $cat_array[thecat].parent eq $parentCat}
{if $cat_array[thecat].safename eq $requested_cat}
{if $pagename eq "published"}
<a href="{$URL_maincategory, $cat_array[thecat].safename}" style="padding-bottom:5px;">{$cat_array[thecat].name}</a>
{else}
<a href="{$URL_queuedcategory, $cat_array[thecat].safename}" style="padding-bottom:5px;">{$cat_array[thecat].name}</a>
{/if}

{else}
{if $pagename eq "published"}
<a href="{$URL_maincategory, $cat_array[thecat].safename}" style="padding-bottom:5px;">{$cat_array[thecat].name}</a>
{else}
<a href="{$URL_queuedcategory, $cat_array[thecat].safename}" style="padding-bottom:5px;">{$cat_array[thecat].name}</a>
{/if}

{/if}
{/if}
{/section}
</div>
{/if}</span>


{elseif $pagename neq 'submit'}

<div id="headbar" style="border-bottom:1px solid #ccc;padding-bottom:4px">
{section name=thecat loop=$cat_array}

{if $cat_array[thecat].parent eq 0}
<a href="{$URL_maincategory, $cat_array[thecat].safename}">{$cat_array[thecat].name}</a>
{/if}
{/section}


<br/>
{else}<div id="border" style="border-bottom:6px solid #fff;padding:12px"></div>
{/if}
</ul></div>



-----------------------------------------------------------------------------------
Reply With Quote
  #29 (permalink)  
Old 07-15-2007, 08:23 AM
Constant Pligger
 
Join Date: Apr 2007
Posts: 1,042
I´m using subcategories for geographical order with 10+ subcategories. Is it possible to display the categories in the sidebar as default values of a drop-down list that contains the category and its (indented) subcategories?
Reply With Quote
  #30 (permalink)  
Old 07-15-2007, 08:33 AM
New Pligger
 
Join Date: Jul 2007
Posts: 15
I think version 9.7 already has this feature of displaying Categories and their Sub-categories in the side bar.

Cheers
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[MOD] Submit-step2 Digg like categories selection with radio button dollars5 Questions and Comments 73 04-02-2011 09:29 PM
Shredit - Categories on header? b4ifuru18 Questions and Comments 2 07-22-2009 10:13 PM
In 1.0RC5 - Digg like categories in Submit-step2 selection with radio button arif1999 Questions and Comments 1 07-02-2009 11:46 AM
HELP: Drop Down Categories in Header Tutorial for ver 9.9.5 arkasun Questions and Comments 3 10-19-2008 10:39 PM
Categories like in Digg rhythm Questions and Comments 7 05-26-2007 03:14 PM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development