Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-12-14 21:48:09

chriloi
Plugin Author
From: Vienna, Austria
Registered: 2006-01-17
Posts: 120
Website

[plugin] [ORPHAN] cnk_section_tree - subsection plugin

This is a section hierarchy / subsection plugin.

Download version 0.3.10: http://www.cnowak.de/works/txp_plugins/cnk_section_tree_v0.3.10.txt
Download compressed 0.3.10: http://www.cnowak.de/works/txp_plugins/cnk_section_tree_v0.3.10_compressed.txt

2009-05-30:
– As of version 0.3.10 the default section will be shown by default when using cnk_breadcrumb and cnk_sec_list. Both tags have an attribute “show_default” which hides the default section when set to “n”
– Users experiencing problems when opening the write tab, may set the CNK_REWRITE_SECTION_DROPDOWN constant to false on the first line of the plugins source code

Note: After you have installed and enabled the plugin, you have to start it’s database install routine on the tab “extensions”->“section_tree”. If you don’t like the plugin, you can always deinstall it on the same page.

Documentation:

Use <txp:cnk_breadcrumb /> to render a breadcrumb menu. Following parameters are accepted by the tag:

param name description accepted values / default value
append_article_title appends the article title (‘y’ ; ‘n’ ; default: ‘n’)
url_pattern defines the href attribute of section links. %s is the section name, %u is site_root_url (string ; default depends on txp’s permlink_mode)
show_default show default section (‘y’ ; ‘n’ ; default: ‘y’)
default_title defines the name of the default section (string ; default: home)

Use <txp:cnk_sec_list /> to render the tree. Following parameters are accepted by the tag:

param name description accepted values / default value
active_section_articles whether to show article list of active section or not (‘y’ ; ‘n’ ; default: ‘n’)
active_section_article_order_by order article list by (‘posted’ ; ‘lastmod’ ; ‘title’ ; default: ‘posted’)
active_section_article_order order article list direction (‘asc’ ; ‘desc’ ; default: ‘asc’)
active_section_article_max_count limit articles. if set to 0, all articles will be rendered (integer ; default: 5)
exclude_sections comma separated list of section names that should not show up in the tree. subsections of excluded sections won’t show up either (‘name1’,‘name2’ ; default: ‘’)
start_section name of section that should be rendered exclusively. subsections will also be rendered (string ; default: ‘’)
css_id id property of the top-level ul tag (string ; default: ‘cnk_sec_tree’)
css_active_section_class class property of active section element (string ; default: cnk_active_section)
css_active_article_class class property of active article element (string ; default: cnk_active_article)
css_article_class class property of all article elements (string ; default: cnk_article)
css_section_class class property of all section elements (string ; default: cnk_section)
css_section_class_open class property of all opened section elements (string ; default: cnk_section_open)
css_section_class_closed class property of all closed section elements (string ; default: cnk_section_closed)
show_article_count show number of articles with status 4 for every section if at least one article exists. (‘y’ ; ‘n’ ; default ‘n’)
show_article_count_bottom show number of articles with status 4 only for bottom sections if at least one article exists (‘y’ ; ‘n’ ; default ‘n’)
exclude_empties don’t show sections, which have no articles with status 4 assigned to it (‘y’ ; ‘n’ ; default ‘n’)
url_pattern_section defines the href attribute of section links. %s is the section name, %u is site_root_url (string ; default depends on txp’s permlink_mode)
url_pattern_article defines the href attribute of article links. %s is a placeholder for the section name, %a is article id, %t is article url_title, %u is site_root_url, %y(ear), %m(month), %d(ay) (string ; default depends on txp’s permlink_mode)
section_append_hmtl appends string right before the closing li tag of a section. same placeholders as url_pattern_section (string ; default ‘’)
article_count_pattern restyle the article count part of section links. %c is placeholder for article count (string ; default ‘(%c)’)
expand_all Expands all section elements. If set to ‘n’ only the active section and its parents will be expanded. (‘y’ ; ‘n’ ; default ‘y’)
show_default show default section (‘y’ ; ‘n’ ; default: ‘y’)
default_title defines the name of the default section (string ; default: home)

Compatibility tested with:

plugin name version
sed_section_fields 0.2.112 OK

Additional notes:

The section tree has to be configured in the section tab by simply selecting a parent section for each section.

Currently the plugin does not allow to simply change the order of subsections. (If you want to sort them, just add them to their parents in the order you would like to display them.)

Friendly urls will come in one of the next versions. I’m in contact with Graeme to get his permanent links plugin to work with mine.

This is how it looks like so far:

In the backend section tab there is a dropdown to select parent sections:

The section dropdown in the write view is also replaced by a tree dropdown:

Last edited by chriloi (2009-05-29 23:55:36)

Offline

#2 2007-12-14 22:06:38

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: [plugin] [ORPHAN] cnk_section_tree - subsection plugin

Please use a 3 character prefix instead of cn, like all other plugins do :)

Offline

#3 2007-12-14 22:27:53

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Re: [plugin] [ORPHAN] cnk_section_tree - subsection plugin

hey this looks to be something very useful. i would say you definitely continue this plugin! crockery/4.1 is yet to be seen and with no foreseeable release date (will it be available in a years time? 2? 5? apparently no one knows), we might as well have something available right now.

Last edited by iblastoff (2007-12-14 23:52:26)

Offline

#4 2007-12-14 22:31:18

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: [plugin] [ORPHAN] cnk_section_tree - subsection plugin

Looks great. What sort of URL’s does the plugin produce?

Offline

#5 2007-12-14 23:21:12

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: [plugin] [ORPHAN] cnk_section_tree - subsection plugin

There should be possibility to list articles, that are childs of selected section, or to restrict this.


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#6 2007-12-15 05:46:55

chriloi
Plugin Author
From: Vienna, Austria
Registered: 2006-01-17
Posts: 120
Website

Re: [plugin] [ORPHAN] cnk_section_tree - subsection plugin

Subtree deletion and movement implemented.

the_ghost schrieb:

There should be possibility to list articles, that are childs of selected section, or to restrict this.

Just added this function.

jstubbs schrieb:

Looks great. What sort of URL’s does the plugin produce?

As I said in my first post, it doesn’t use the section-tree-path for the url, but only the section name (example: http://yoursite.com/section_name).

ruud schrieb:

Please use a 3 character prefix instead of cn, like all other plugins do :)

Not all plugins do use a 3 char prefix… But I will go with the masses :))

Offline

#7 2007-12-15 08:09:26

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: [plugin] [ORPHAN] cnk_section_tree - subsection plugin

What about sorting subsections?


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#8 2007-12-15 08:21:38

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: [plugin] [ORPHAN] cnk_section_tree - subsection plugin

chriloi wrote:

As I said in my first post, it doesn’t use the section-tree-path for the url, but only the section name (example: http://yoursite.com/section_name).

So if I have this section structure:

Section parent: worldnews – Child of section worldnews: europe

Would this give me a URL of: /worldnews/europe

Or: /europe

Last edited by jstubbs (2007-12-15 08:22:47)

Offline

#9 2007-12-15 08:39:12

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Re: [plugin] [ORPHAN] cnk_section_tree - subsection plugin

jstubbs wrote:

As I said in my first post, it doesn’t use the section-tree-path for the url, but only the section name (example: http://yoursite.com/section_name).

So if I have this section structure:

Section parent: worldnews – Child of section worldnews: europe

Would this give me a URL of: /worldnews/europe

Or: /europe

would give you /europe. like his example showed.

Last edited by iblastoff (2007-12-15 08:43:06)

Offline

#10 2007-12-17 13:33:45

chriloi
Plugin Author
From: Vienna, Austria
Registered: 2006-01-17
Posts: 120
Website

Re: [plugin] [ORPHAN] cnk_section_tree - subsection plugin

Added some more options for the list tag and replaced the section dropdown in the write tab with a “tree”-dropdown.

Offline

#11 2007-12-17 19:49:30

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: [plugin] [ORPHAN] cnk_section_tree - subsection plugin

This looks great! Many of us have been waiting for subsections for a long time…

Give it the flexibility and configurability of stw_category_tree and you’ll be mr.popular.

Last edited by mrdale (2007-12-17 19:59:29)

Offline

#12 2007-12-17 20:12:44

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: [plugin] [ORPHAN] cnk_section_tree - subsection plugin

I think it’s a positive to have multiple plugins. I’m glad to see cnk_section_tree! Different approaches help keep us flexible, creative, and inspired. Plus some plugins get stale, forgotten, or fall out of date/become unsupported.

For the sake of curiosity, how does cnk_section_tree differ from mtp_subsections? IIRC it also allows assigning a parent section, and offers a section tree for navigation.

Thanks

Mike

Last edited by maverick (2007-12-17 20:14:52)

Offline

Board footer

Powered by FluxBB