Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-04-04 20:48:08

2ndreality
New Member
Registered: 2007-04-04
Posts: 4

TXP as CMS with simple 2 level navigation structure

Hi there,

at the moment I’m playing with Textpattern and I like it very much :)

I’m going to find a system which can handle a simple static content structure in a hierarchical way with only 2 levels (section -> article). Highlighting of the active section and active article in the menu ist very important.

I’ve found the plugin “stw_category_tree” – but with this plugin I’ve have to organize my content in the way of displaying – this is a very rigid approach, too rigid for my understanding.

Is there another way to create this kind navigation off the mark with the stw_category_tree plugin?

Thanks a lot,

2d

Last edited by 2ndreality (2007-04-04 20:49:55)

Offline

#2 2007-04-04 21:48:17

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: TXP as CMS with simple 2 level navigation structure

Can you give an example of the output you’re looking for?

Offline

#3 2007-04-05 01:02:39

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: TXP as CMS with simple 2 level navigation structure

You mean: http://site.com/section-title/article-title/? Just go to admin>prefs and set your URL structure to /section/title.

Offline

#4 2007-04-05 08:08:22

2ndreality
New Member
Registered: 2007-04-04
Posts: 4

Re: TXP as CMS with simple 2 level navigation structure

Thanks for replies :)

An example is a good idea: http://www.dasdojo.com/

Simple 2 level navi and as you can see there are the active menu items highlighted via CSS.

Most important point for me is to have the possibility to get an active_class in the menu for the current section and the current article. Txp:section_list does only the section and for the active article is’nt a build in functionality in TXP when create my submenu with txp:custom_article (with a form which only shows the titles).

With the category_tree plug is this doable, but I’m looking for another way without preorganizing my content in categories…

@jim: Thank you for the hint – I did this already.

2d

Last edited by 2ndreality (2007-04-05 08:12:54)

Offline

#5 2007-04-05 09:25:58

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: TXP as CMS with simple 2 level navigation structure

Try this (see a few posts down for walk through) for an active class on both the section and article.

Offline

#6 2007-04-05 10:21:17

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: TXP as CMS with simple 2 level navigation structure

jm wrote:

Try this (see a few posts down for walk through) for an active class on both the section and article.

That would be very good for the How tos and examples forum … except it is closed:(


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#7 2007-04-12 02:07:59

2ndreality
New Member
Registered: 2007-04-04
Posts: 4

Re: TXP as CMS with simple 2 level navigation structure

Thanks for the Link.

After some trials and errors I’ve found a way which is in detail different to the PHP-URL-Grabber solution.

My 1st level menu highlights are implemented via matching pairs of CSS selectors too, based on this approach as mentioned in the linked thread.

And for the active article I’m using a plugin: glx_hl_current – instead of embedded PHP-Code in my forms.

Some words about further requirements and structure:

My TXP-Core is using SEF-URLs (section/title). Every “page” on the frontend of the website is an article, posted in the section which belongs to the article. I don’t use categories for something.

I hardcoded the 1st level Menu (the sections) manually as a form (named mainNavi) for embedding in every Textpattern page.


<ul>
<li><a href="/section/article-name1" class="section1">MenuItem 1</a></li>
<li><a href="/section/article-name1" class="section2">MenuItem 2</a></li>
.
.
.
</ul>

The section/article-nameX in the URL is necessary for the glx_hl_current plugin. If you only link to the section then an article is displayed but not highlighted in the 2nd level menu.

And my 2nd level menu will be generated automatically via the article_custom Tag and a form.

The article_custom snippet for the page:

<ul><txp:article_custom form="subNavi" section="sectionname" /></ul>

The snippet for the form (named subNavi) is ready too for including in the other pages:

<li><a href="<txp:permlink />" title="<txp:title />" <txp:glx_hl_current_article class="subCurrent"/>><txp:title /></a></li>

Here is the complete code for a working puristic 2 level navi on a Textpattern page:

<txp:output_form form="header" />

mainNavi

<txp:output_form form="mainNavi" />

SubNavi

<ul><txp:article_custom form="subNavi" section="name" sort="custom_2" /></ul>

<txp:output_form form="footer" />

Header and Footer are forms too, they hold the XHTML-Tags for head, html, CSS-Links etc.. CS-Sheets with special selectors and classes are required! The sorting method based on integers in a custom field for every article.

Hope it is not the most difficult way. One plugin is needed, therefore no embedded PHP-Code or conditionals. During the tests it worked fine – next days I’m going to deploy a complete website with TXP and this structure.

2nd

Last edited by 2ndreality (2007-04-12 08:44:27)

Offline

#8 2007-04-12 05:52:03

FireFusion
Member
Registered: 2005-05-10
Posts: 698

Re: TXP as CMS with simple 2 level navigation structure

For sections

I use CSS and the <txp:section /> tag. First put this as the body tag…

<body class="<txp:section />">

Then I use semantic, meaningfully mark-up for the main navigation.

<!-- Navigation -->
<div id="nav_main">
<h2>Site features</h2>
<ul id="nav_sections">
   <li id="nav-home"><a href="/home">home</a></li> 
   <li id="nav-about"><a href="/about">about</a></li> 
   <li id="nav-project"><a href="/project">project</a></li> 
   <li id="nav-contact"><a href="/contact">contact</a></li> 
</ul>
</div>

And in the CSS I do the following…

.default #nav-home, 
.about #nav-about,
.project #nav-project, 
.contact #nav-contact{
	font-weight: bold;
}

For Articles

I use glx_hl_current plugin.

Offline

#9 2007-04-12 08:40:47

2ndreality
New Member
Registered: 2007-04-04
Posts: 4

Re: TXP as CMS with simple 2 level navigation structure

This is exactly the same what I described above FireFusion ;)

My 1st level menu highlights are implemented via matching pairs of CSS selectors too, based on this approach as mentioned in the linked thread.

And for the active article I’m using a plugin: glx_hl_current – instead of embedded PHP-Code in my forms.

2nd

Last edited by 2ndreality (2007-04-12 08:44:44)

Offline

Board footer

Powered by FluxBB