Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#16 2005-04-03 03:15:51
- marios
- Archived Plugin Author

- Registered: 2005-03-12
- Posts: 1,253
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
I see 3 cubes that say “I too……”,How strange,
I’m not sure if this is a halluszination or a PunBB Bug again.
Anyhow,I think I better go to bed now.
⌃ ⇧ < ⎋ ⌃ ⇧ >
Offline
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
i get it to work but it automatically selects the latest article in each list. is this the expected behaviour? i’m on rc3.
Offline
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
(seems like editing doesn’t work here..?)
i forgot to add that i meant “…when viewing the start page for each section”.
Offline
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
btw, could you please make sure the links are wrapped in a double quotation mark (“”) and not a single (‘’)? the same goes for the class=active thing that misses the quotes.
oh, and one last thing: i’m using class=“current” on everything else, could you add an attribute like active: active; (where one could change that to something else)? would be awesome :)
did i say i like thie plugin a lot? i did, didn’t i? ;)
Offline
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
I’ve been looking for a plugin that does exactly what your plugin does. Awesome! For the last 6 weeks I have been in contact with a programmer whom I asked to create a plugin that can handle main-navigation and sub-navigation, maybe even sub-sub-navigation by using section, article and article 2 … but now it is here. Great!
Thank you.
Nils
Offline
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
Sorry, I some of the posts on my rdt_dynamenus plugin. It’s nice to know that they fill the same need for others as for me.
nils73:
I wonder what and how an article 2nd level would look like and work.
anton:
i will add an active parameter that defaults to active to both functions
<code>
‘active’ => ‘active’,
</code>
and wrap quotes around $active.
I don’t follow your other request to use double quotes however. single quoted attributes are valid XML and single quotes allow me to use convenient variable interpolation, like so.
<code> $tagatts[] = ($s == $sect) ? “ class=’$active’” : “”; </code>
anton: also, yes it’s expected behavior for a section to select the topmost article. Normally, that’s the latest article but you can control that with the sortby and sortdir attributes. If you display multiple articles in the center content div then you must also ensure they sort in the same sequence in which case you may need to use the chh_article_custom plugin to get that kind of control.
tranquillo: so don’t do that. remember that section names appear in the URL and the ampersand would indicate a CGI parameter. I’ve used it like so “golf_tournament” here at http://spiritofcj.org
harryv: this plugin does lots that section_list does not. for 2 instance, it lets you specify a special section as the “home” section and puts it at the top of the list. It tags the currently selected section with a class=active attribute so you can write CSS to highlight or underline the current section. In general it’s designed to enable a self-configuring, self-maintaining so-called static website. You create a new section and bang, it’s on the menu. add a new article to a section and bang, it’s on the menu. Read the docs.
Michael_art: Did you solve your messy URL problem? If not, perhaps you need to adjust your .htaccess file. when using a subdirectory i’ve found it necessary to adjust the rewrite rule. You may need to say
<code><RewriteRule (.*) /home/michael/public_html/index.php
/code>
andjules: I don’t visualize how categories work. I won’t follow up on your suggestion, until I think i need 3-dimensional menus.
TV? Buglight for humans.
Offline
#22 2005-04-08 15:57:14
- davidm
- Member

- From: Paris, France
- Registered: 2004-04-27
- Posts: 719
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
Great plugin, will certainly try it as it will greatly help simplify things :)
.: Retired :.
Offline
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
thanks for your response rdtietjen, i didn’t notice them until now :)
as for double quotes: depending on the DOCTYPE, it’s sometimes valid, sometimes not. sticking to double quotes leaves this up to the site owner to decide, which was also the only thing i was after.
looking forward to 0.4…
Offline
#24 2005-04-22 10:14:27
- marios
- Archived Plugin Author

- Registered: 2005-03-12
- Posts: 1,253
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
I am experimenting with rdt_dynamenus for my news site template.
Well it perfectly suits my needs,I have a question about this.
I am using the rdt_article menu tag for my sidelinks.Well everything works precisely as expected and exactly the way I had planned it except one thing.
For each article sidelink I would like to display an excerpt summary of the corresponding article(not more then 25 words count)below each link and allso be able to apply a class to it.)
Because I’m new to textpattern I’ll ask first this:Is that something that I could achieve in combination with existing TXP tags,or does the plug in need to be hacked in to allow excerpts.
(Basically from generated XHTML that would make more sense then with definition lists.)
It would be nice to see this wunderfull plug in with more features,
Is there any hack technique that can be used?
regards,marios
⌃ ⇧ < ⎋ ⌃ ⇧ >
Offline
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
> marios wrote:
> I am experimenting with rdt_dynamenus for my news site template.
Well it perfectly suits my needs,I have a question about this.
I am using the rdt_article menu tag for my sidelinks.Well everything works precisely as expected and exactly the way I had planned it except one thing.
For each article sidelink I would like to display an excerpt summary of the corresponding article(not more then 25 words count)below each link and allso be able to apply a class to it.)
> Because I’m new to textpattern I’ll ask first this:Is that something that I could achieve in combination with existing TXP tags,or does the plug in need to be hacked in to allow excerpts.
> (Basically from generated XHTML that would make more sense then with definition lists.)
> It would be nice to see this wunderfull plug in with more features,
Is there any hack technique that can be used?
marios,
The article menu plugin begin life as a derivation of chh_article_custom. chh_article_custom has lots of nice features including what you want: the ability to pass in a form to show the article information. On the other hand, chh lacked active class marking and switched to single article display when not at the section level.
My initial plugin simplified chh so I could send you my initial code to hack. I switched to the current code because it was easier to document and it followed the prevailing idiom of similar plugins. Or you could hack the current code to accept an optional form parameter, I suppose. I’ll keep the idea in mind.
TV? Buglight for humans.
Offline
#26 2005-04-22 22:54:52
- marios
- Archived Plugin Author

- Registered: 2005-03-12
- Posts: 1,253
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
Thanks for your explanation and advise rdtietjen.One question:
What would be the basic differnce betwween the initial code and the download code in short, just so I may understand what you explain?
⌃ ⇧ < ⎋ ⌃ ⇧ >
Offline
#27 2005-04-24 21:14:17
- jpdupont
- Member
- Registered: 2004-10-01
- Posts: 752
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
Is it possible to improve this plugin with section alias , to be allowed to use (french or others) accentuated chars in section links ?
Offline
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
Hi jpdupont,
The problem is that TXP converts all accents to written out charstrings for the article url and these are then displayed on the site i.e. incorrectly for the language. I made a fairly inelegant hack to the plug-in for German for converting back the charstring to a correctly displayed German name. There may well be a better approach.
At the time I was working on a dual language setup and had named all my sections with a prefix “de-sectionname” or “en-sectionname” so I added an input variable for the plugin called “langprefix”. Again this prefix needed stripping out for the menu.
I only needed rdt_section_menu. This is what I changed.
1. in the variables array near the top of the rdt_section_menu function [ extract(lAtts(array( … ] I added an additional line as follows before the closing [ ),$atts)); ]
<pre>
‘langprefix’ => ‘’, // new langprefix variable
</pre>
2. A bit further down before the following string:
<pre>
$content = preg_replace(“/-/”,” ”,$content);
$content = ucwords($content);
</pre>
I added
<pre> if (!empty($langprefix) and $langprefix 'en') { $content = preg_replace("/en-/","",$sectionname); } if (!empty($langprefix) and $langprefix ‘de’) { $content = preg_replace(“/de-/”,”“,$sectionname); $content = ucwords($content); $content = preg_replace(“/ae/”,”ä”,$content); $content = preg_replace(“/oe/”,”ö”,$content); $content = preg_replace(“/ue/”,”ü”,$content); $content = preg_replace(“/Ae/”,”Ä”,$content); $content = preg_replace(“/Oe/”,”Ö”,$content); $content = preg_replace(“/Ue/”,”Ü”,$content); $content = preg_replace(“/sz/”,”ß”,$content); } </pre>You will need to change the search and replace strings for the French equivalents depending upon how they have been written out (that is if that is at all possible). The first line with prefix replacement you may not need as that was just my setup, likewise if you don’t want capitalised names then the second ucwords you will also not need.
If charstrings cannot be converted back for French because they are no longer discernably different from their normal appearance (in German it’s a little easier) maybe the approach with section aliases would work better for you where you define equivalent strings for your section URLs.
….
I also made some further hacks, though these aren’t directly related to the language thing
3. to work with a subdirectory install of TXP I changed the variable $pfr into hu. The URLs It generates are then absolute URLs. This works for a whole variety of plug-ins now that the path-from-root $pfr is deprecated and removed from the admin panel.
4. AFAIK the underscore “_” is no longer allowed in section names, but the – is used for a space. I changed the line:
<pre> $content = preg_replace(“/_/”,” ”,$content); </pre>into
<pre> $content = preg_replace(“/-/”,” ”,$content); </pre>TXP Builders – finely-crafted code, design and txp
Offline
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
can’t edit the above post so please note: all the above applies to RC3.
Secondly textile changes some of the code above. The quotes are all normal straight quotes and the replaced characters were expressed as their &# entities.
TXP Builders – finely-crafted code, design and txp
Offline
#30 2005-04-25 13:52:35
- jpdupont
- Member
- Registered: 2004-10-01
- Posts: 752
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
Thanks jakob,
I try this on RC3.
Your hack is not usefull with french : in sections, école give -> ecole.
I need here true alias approach ….
BTW, I don’t understand “hu” here : …TXP I changed the variable $pfr into hu…
Offline