Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-03-05 16:44:40

trenc
Plugin Author
From: Amsterdam
Registered: 2008-02-27
Posts: 571
Website GitHub

yab_navigation - A navigation management plugin

Grab it here
yab_navigation_v0.1.beta.zip
or here
yab_navigation_v0.1.beta.tar.gz

There are a couple of browser issues this time, namely for Opera, all Internet Explorer versions and Konqueror. Some are CSS-related, some Javascript related. Because of these issues this is a beta release. I will try to fix this issues asap.

Feature Screencast

Screencast on Vimeo

(Maybe a mod or an admin can embed this video here.)

What you need to know

The navigation used and generated by yab_navigation is based on a »simple« template of Textpattern tags (<txp:variable />, <txp:section_list />, <txp:article_custom /> etc.). This navigation will be saved in a form called »yab_navigation« (Opps!). This form will be created automatically.

Since the navigation is saved in this form you can call the navigation with the following command in your page template:

<txp:output_form form="yab_navigation" />

And your articles you can call simply with:

<txp:if_individual_article>
  <txp:article status="4" limit="1" />
<txp:else />
  <txp:article status="5" limit="1" />
</txp:if_individual_article>

in your page template(s).

For your frontpage you need a section with the value »On front page« set to »yes« and the same title as the home_title in the configuration (see below).

That’s all actually, but

What you really need to know

Since Textpattern sections and articles are completly different in behaviour and database structure and they are not only pages – as maybe known from other CMS – this plugin can only be an approach, of course. For understanding the concept I have to explain something.

The first section on the left side in your backend navigation will represent your frontpage aka your home. So the name of this section is only shown in the plugin, The real name, which is shown as a link in your frontend navigation is set in the config (see below).

The first article (first list point) of every section in the backend navigation will represent the parent section in the frontend navigation. This article will always be fixed (status 5) and is not displayed in the frontend navigation. So the name of the article is only shown in the backend navigation.

The rest of the articles will be shown in the frontend navigation in the order you choose.

What you maybe need to know

When you install the plugin and you go to the backend navigation, your whole navigation is shown of the right.

Reload the site again

Now your navigation should be shown on the left side but maybe it looks weird. This is because the plugin reads the whole stuff from database and not from a navigation template, because this is still empty. You have to move a section to force the generating of the navigation template. When done, reload the backend page again.

Now you should see on the right side a place where you can see hidden or new detected sections – if they exist.

If something won’t work or you can’t see the navigation on the left side, go to you form templates and empty the yab_navigation form. Then begin anew in the navigation backend.

Useful things you need to know

Every new created section is hidden by default, you have to move it from the right side in your backend navigation. Every created article is hidden by default, except if it is the first article of a section, then it’s fixed.

Btw. hiding the first article of a section doesn’t really make sense. :)

Renaming a section or an article will not change the name of section or the URI of the article. It will only rename the title of the element. I’ve decided for this behaviour because of the URI consistence (»Cool URI’s don’t change!«).

If you ever delete or rename a section in the Textpattern section menu you are lost.
Not really but …
If you have deleted a section this way you only have to hide this section in the backend navigation. Next time (or after a reload) this section will disappear.
If you have renamed a section this way … uh … fucked up! You have have to empty the yab_navigation form and build your navigation in the backend anew. Sorry!

Really useful things you need to know

There are configuration options for the plugin. You will find them in an array $yab_nav_prefs in the plugin code:

Option Description Default
home_title The title of the frontpage. Has to be the same title as your frontpage section title. Home
sort The sort order for the articles position asc
active_class Active class for sections or articles active
passive_class Passive class for sections or articles passive
exclude_sections Here you can completly exclude sections from navigation listing (comma delimited) (empty)
exclude_articles Here you can set sections, which articles will not be listed in the navigation. Useful for a news section or a section which does not have a single article as content. And you can’t move other articles in this section in the backend. (comma delimted) (empty)
section_default_page Default page template when creating a section default
section_default_css Default CSS when creating a section default
section_default_rss Should be created sections include in RSS Feed? 0
section_default_frontpage Should be created sections on frontpage? 0
section_default_searchable Should be created sections searchable? 1
jquery_ui The link to the jQueryUI Script min. JS from Google CDN
article_limit Hard limit for backend navigation article list 30

If you develop sites locally with no internet connection or you don’t like Google, you can change the jquery_ui link to a local jQueryUI framework. If you want to minfy the script, you don’t need to load the complete jQueryUI framework. The only things you need are Core, Widget, Mouse and Sortable. (http://jqueryui.com/download)

The function yab_nav_gTxt below the configuration array is used for the localisation and language. You can edit this on your own.

Other things you need to know

Deleting sections or articles will not be implemented. For deleting sections or articles you have to go the standard way.
The rights management (user privileges) could be bypassed by this plugin, if you set the rights for this plugin lazier than other rights are (for example access to editing sections in the section tab).
The plugin does only know the article status fixed (5), live (4) and hidden (2). Other status – as draft or pending – will be overwritten!

Things you really don’t want to know

This plugin is made with some Javascript, jQuery, jQuery UI, XML (really), AJAX, PHP, Textpattern, Debian, Kate, Firefox/Iceweasel. I like the Allman style for php coding with a maximal measure of 80 chars – if you ever look at the plugin code. And if you have seen the feature screencast, this is made with recordMyDesktop and converted with mencoder.

Last edited by trenc (2010-03-07 12:06:50)

Offline

#2 2010-03-05 18:58:19

jelle
Member
Registered: 2006-06-07
Posts: 165

Re: yab_navigation - A navigation management plugin

WOW Tommy!

This looks absolutely amazing!
Can’t wait to try it.

Offline

#3 2010-03-06 08:21:33

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: yab_navigation - A navigation management plugin

Tommy,

I install your plugin on 2 sites.
Impossible to move the sections/articles from right (Yes, I see all the stuff here) to left.

I work on FIREFOX 3.6

Actually, I just install/activate the plugin then go the extention>manage navigation tab.

What I’m missing ???

Offline

#4 2010-03-06 09:40:27

jelle
Member
Registered: 2006-06-07
Posts: 165

Re: yab_navigation - A navigation management plugin

jpdupont wrote:

Impossible to move the sections/articles from right (Yes, I see all the stuff here) to left.

I have the same problem here. I’m unable to drop items on the right. Both in Firefox 3.5 and Internet Explorer.

Also, IE doens’t show the little icons.

Still…it’s a GREAT plugin! Where do I donate?

Offline

#5 2010-03-06 09:52:14

candyman
Member
From: Italy
Registered: 2006-08-08
Posts: 684

Re: yab_navigation - A navigation management plugin

trenc wrote:

Deleting sections or articles will not be implemented. Think: An user could really delete an article! No way! The right management (user privileges) could be bypassed by this plugin.

Sorry, I didn’t understand. You mean that the privileges could or couldn’t be bypassed by the plugin? I mean not if deleting sections or articles will not be implemented.

The plugin does only know the article status fixed (5), live (4) and hidden (2). Other status – as draft or pending – will be overwritten!

Overwritten with… ? They become visible?

I like the Allman style for php coding with a maximal measure of 80 chars – if you ever look at the plugin code.

Thanks, I’ve learned something new.

Offline

#6 2010-03-06 10:51:46

trenc
Plugin Author
From: Amsterdam
Registered: 2008-02-27
Posts: 571
Website GitHub

Re: yab_navigation - A navigation management plugin

Hi jpdupontm, hi jelle,

if you see all the navigation on the right side on not of the left and a page reload does not affect this status, so go to the form templates an delete the content of the yab_navigation form. Then go to the management backend and then reload the backend again.

I think, I will code something as a thirst install routine next release.

Offline

#7 2010-03-06 10:58:26

trenc
Plugin Author
From: Amsterdam
Registered: 2008-02-27
Posts: 571
Website GitHub

Re: yab_navigation - A navigation management plugin

Hi Alessandro,

my writings are often misunderstood, my english, my fault:(
I mean the privileges could bypassed. So when you rename a section, but section tab is only visible to editors and not writers nor freelancers. But writers or freelancers could rename a section in the management tab.

Overwritten with… ? They become visible?

Yes!
Mabye next releases the plugin will respect the set status of an article.

Offline

#8 2010-03-06 11:09:43

candyman
Member
From: Italy
Registered: 2006-08-08
Posts: 684

Re: yab_navigation - A navigation management plugin

Thanks for the explanations.

In the next release will you fix the privileges too?
I think that the privileges shouldn’t be bypassed: is there a reason you made this choice?

Last edited by candyman (2010-03-06 11:09:53)

Offline

#9 2010-03-06 14:24:55

jpdupont
Member
Registered: 2004-10-01
Posts: 752

Re: yab_navigation - A navigation management plugin

Tommy,

:) Now, I see the left part of the backend.

But …

Do you modify the initial sections settings (remove from/set on the front page) ?

Is it possible to use the plugin without modifying this settings, like stm_article_order ?

Offline

#10 2010-03-07 12:14:25

trenc
Plugin Author
From: Amsterdam
Registered: 2008-02-27
Posts: 571
Website GitHub

Re: yab_navigation - A navigation management plugin

In the next release will you fix the privileges too?
I think that the privileges shouldn’t be bypassed: is there a reason you made this choice?

The privileges will only be bypassed when you set the add_privs('yab_navigation','1, 2'); in the plugin to a lazier value as – for example – the value for the admin section tab. If both have the same rights, nothing will bypassed.

Last edited by trenc (2010-03-07 12:15:35)

Offline

#11 2010-03-07 12:28:22

trenc
Plugin Author
From: Amsterdam
Registered: 2008-02-27
Posts: 571
Website GitHub

Re: yab_navigation - A navigation management plugin

Do you modify the initial sections settings (remove from/set on the front page) ?

Is it possible to use the plugin without modifying this settings, like stm_article_order ?

With stm_article_order you can’t create or order sections.
The Textpattern original initial section setting (for creating a new section) are partly user modified (page template and css template for your default section in the section tab, since r3329) and partly hardcoded (is_default = 0, in_rss = 1, on_frontpage = 1).

The plugin offers you the abilty, to create new sections with your own defaults – you can set these in the $yab_nav_prefs array.

Last edited by trenc (2010-03-07 12:28:46)

Offline

#12 2010-03-07 15:27:31

amordecosmos
Plugin Author
From: London (Hometown: Vancouver)
Registered: 2004-08-03
Posts: 106
Website

Re: yab_navigation - A navigation management plugin

I have tried this with Safari (latest) Chrome (latest) and Firefox (latest) on a Mac, and I get nothing but a static list down the left-hand side.

No right hand side nor anything clickable.

What have I missed?

Offline

Board footer

Powered by FluxBB