Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#97 2005-11-04 05:53:55
- Finnish
- Member
- From: Russia, Vladivostok
- Registered: 2005-11-02
- Posts: 13
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
hi.
i had to modify the code:
<code>$linkref = preg_replace(“/\/default/”,”“,$linkref);</code>
to
<code>$linkref = preg_replace(“/\/default/”,”/”,$linkref);</code>
to make the link to homepage work in opera 8.5 like in IE 6.0 with sect/id/title permalink mode.
without this modification opera treated link with empty href as a link to current section.
have a nice day :)
Offline
#98 2005-11-04 05:55:02
- Finnish
- Member
- From: Russia, Vladivostok
- Registered: 2005-11-02
- Posts: 13
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
now it points to a root of website :)
have a nice day :)
Offline
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
> Finnish wrote:
> now it points to a root of website :)
is that what you want or is that a problem if txp is in a subdirectory?
what version are you using? My versions 0.8 and 0.9 already have
<code>
// for order=“default,xxx,yy”: remove /default
$linkref = preg_replace(“/\/default/”,”/”,$linkref);
</code>
TV? Buglight for humans.
Offline
#100 2005-11-06 17:17:43
- newnomad
- New Member
- Registered: 2005-06-11
- Posts: 5
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
How about making this a nested list istead of 2 seperate lists?
Offline
#101 2005-11-07 01:20:16
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
> newnomad wrote:
> How about making this a nested list istead of 2 seperate lists?
why don’t you mock up the HTML you’d like to be emitted?
TV? Buglight for humans.
Offline
#102 2005-11-07 09:20:57
- newnomad
- New Member
- Registered: 2005-06-11
- Posts: 5
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
<div id=“navcontainer”>
<ul>
<li><a href=”#”>Milk</a>
<ul>
<li><a href=”#”>Goat</a></li>
<li><a href=”#”>Cow</a></li>
</ul>
</li>
<li><a href=”#”>Eggs</a>
<ul>
<li><a href=”#”>Free-range</a></li>
<li><a href=”#”>Other</a></li>
</ul>
</li>
<li><a href=”#”>Cheese</a>
<ul>
<li><a href=”#”>Smelly</a></li>
<li><a href=”#”>Extra smelly</a></li>
</ul>
</li>
</ul>
</div>
sublists are the articles, main lists the sections
isn’t this sementically more correct?
OT
how does one insert code here?
Offline
#103 2005-11-11 16:30:48
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
> newnomad wrote:
> How about making this a nested list istead of 2 seperate lists?
<small>(I think)</small> This is not possible with the current version of the plug-in. Also, I think it will not be possible with future versions.
But maybe you can hardcode it easily, and also keep some dynamic functionality.
<code>
<ul>
<li><a href=”/milk”>Milk</a>
<ul>
<txp:article_custom section=“milk” form=“title” status=“sticky” />
</ul>
</li>
<li><a href=”/eggs”>Eggs</a>
<ul>
<txp:article_custom section=“eggs” form=“title” status=“sticky” />
</ul>
</li>
<li><a href=”/cheese”>Cheese</a>
<ul>
<txp:article_custom section=“cheese” form=“title” status=“sticky” />
</ul>
</li>
</ul>
</code>
Then, you add an article form name “title”, with this inside:
<code><li><txp:permlink><txp:title /></txp:permlink></li></code>
That’s all.
@ rdtietjen
I have wrote this tutorial for building static/dynamic site with dynamic two/three level nav
It’s all based in your plug-in. :D
Offline
#104 2005-11-14 21:55:28
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
I’m having a little issue with this plug-in.
I’m using this code:
<txp:rdt_article_menu active="active" class="" id="secundario" limit="5" sortby="custom_1" sortdir="asc" status="sticky" />
As expected, this simple outputs a list with article titles.
The problem is: when i’m in the section frontpage (/_section_), the first “li” in the list get class="active"
applied .
The expected behaviour is: not to add class="active"
to any article list item in section frontpage (because there isnt a real current article: we are in an article_list context, not in individual page).
I have tested this in two txp installations and in both the class="active"
is added to the very first list item (in the list generated by rdt_article_menu) when you are in article_list context.
<b>@ rdtietjen</b>
I have seen that you also have the same “problem” in your site, at http://publishingpipelines.com/articles
When you are in that URL (/articles, that is a section frontpage), you have the first article list item (“Building a pipeline” at the moment of writing this) highlighted.
The “true” is you are not in individual-article context, but because in your /articles section you show only the last article (“Building a pipeline” article, in this case), it makes sense to highlight it as it is the “current” article. Do I explain myself?
So, my question/request is:
can you add an attribute to highlight (ie. add class="active"
) only when you are in individual_article context?.
With this attribute turned on, if you are in section frontpage (article_list context), none of the article list items (generated by rdt_article_menu) gets class="active"
applied. And if you are in individual_article context, then the class is applied to the current article.
With this attribute turned off, you keep the actual behaviour.
The idea is that this new attribute changes the behaviour between the actual behaviour and the one I suggested.
To make it a sentence:
“Add class active to current article when in section frontpage? Yes/No”
Thanks!
ps: the tutorial I wrote about how to do static sites with rdt_dynamenus will lost credibility if the first item in the “subnav” menu gets class=“active” applied when you are in the section frontpage ;)
Last edited by maniqui (2005-11-14 23:59:58)
Offline
#105 2005-11-14 22:06:44
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
Add something to clarify:
I have found this comment in the plug-in code: /* if no ID we’re in list mode, at a section, so tag first article with class=active */
That behaviour is the one I want to change. I dont want to tag first article with class active at a section. :D
Many few words to explain all my previous post.
Offline
#106 2005-11-14 22:19:51
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
maniqui: try commenting out line 107 (or thereabout) which says: $tagatts[] = " class=\"$active\"";
Offline
#107 2005-11-14 22:24:30
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
I found the way to remove the class="active"
from the first list item.
I have changed this:
<pre>
/* if no ID we’re in list mode, at a section, so tag first
article with class=active
*/
$count = $count+1;
if ($pretext[‘id’] $ID) {
$tagatts[] = " class='$active'";
} elseif (empty($pretext['id']) and $count 1) {
$tagatts[] = “ class=’$active’”;
} else {
$tagatts[] = “”;
}
</pre>
to this:
<pre>
/* if no ID we’re in list mode, at a section, so tag first
article with class=active
*/
$count = $count+1;
if ($pretext[‘id’] $ID) {
$tagatts[] = " class='$active'";
} elseif (empty($pretext['id']) and $count 1) {
// $tagatts[] = “ class=’$active’”;
$tagatts[] = “”;
} else {
$tagatts[] = “”;
}
</pre>
See the commented (//) line and the line that follow that line. Those are the only changes.
My request is if this behaviour can be triggered from an attribute.
Finally, my last thought: to add class="active"
to the first item seems to only have a sense if you are displaying one article in section frontpage (/section).
In the other side, if you are displaying more than one article in the section frontpage, to highlight an item in the article list could be confusing.
Offline
#108 2005-11-14 22:27:15
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
Hi Anton.
thanks for replying!
At the moment I pressed “Submit” button for my last post, I received the e-mail notification that someone (you) has replied to the topic.
Hehehe, what you suggest is exactly what I was posting, at the same time.
Telepathic!
Offline