Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
> Vitruvius wrote:
> OK – I can get rid of the error by commenting out the line:
<code>$pfr = $pfr ? $pfr : hu;</code>
> Haven’t been following the thread above – but maybe this was expected?
thanks for letting me know; i’ve been doing other things than tracking the interaction between TXP’s evolution and my rdt_dynamenus plugin.
Did your version of function rdt_section_menu look like this?
<code>
global $s, $pfr;
$out = array();
$pfr = $pfr ? $pfr : rhu;
</code>
with, as Jakob points out, $pfr set after the global statement or was $pfr set at the very top of the plugin code?
I guess I could change the code to simply use hu instead of $pfr
<code>
$linkref = ‘ href=”’. hu .$sect.’”’;
</code>
I think that would preserve RC1 compatibility.
TV? Buglight for humans.
Offline
#62 2005-08-21 16:42:28
- ingrid
- New Member
- Registered: 2004-12-30
- Posts: 2
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
for those using messy urls rdt_section_menu needs the followin modification:
replace the line
<pre> $linkref = ‘ href=”’.$pfr.$sect.’”’; </pre>
with
<pre> if($GLOBALS[‘permlink_mode’] == ‘messy’) { $linkref = ‘ href=”’.$pfr.’?s=’.$sect.’”’; } else { $linkref = ‘ href=”’.$pfr.$sect.’”’; } </pre>
there might be other solutions. this worked for me.
Last edited by ingrid (2005-08-21 16:53:08)
Offline
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
I also needed the plugin to use categories. Although my PHP knowledge is not what I would want it to be, I messed around a bit, compared the code with chh_article_custom and extracted some of the parts responsible for categories from there. I haven’t managed to make it use subcategories, but it does automatically sets the current category if nothing is specified. I didn’t spend much time on it, but it does what I wanted it to do for me. Maybe the creator of the plugin will include the category support in future versions, because it makes it so much more flexible.
Here’s the instructions:
In plugin editor find: <code>‘section’ => ‘’, // good for testing</code>
and add on the next line:
<pre><code>‘category’ => ‘’,</code></pre>
then, after <code>$section = empty($section) ? ‘’ : doSlash($section);</code> add on the next line:
<pre><code> $category = empty($category) ? ‘’ : doSlash($category);
// Categories if (empty($category) and !empty($c)) { $cats = array($c); } else { $cats = empty($category) ? array() : explode(‘,’, $category); } for ($i=0; $i < count($cats); $i++) { if (substr($cats[$i], 0, 1) '.') { $cats[$i] = $c . substr($cats[$i], 1); } elseif (substr($cats[$i], -1, 1) ‘.’) { $cats[$i] = substr($cats[$i], 0, strlen($cats[$i]) – 1) . $c; } $cats[$i] = “ (Category1 = ‘” . doSlash($cats[$i]) . “’ OR Category2 = ‘” . doSlash($cats[$i]) . “’) “; } $categories = ‘’; if (count($cats)) $categories = ‘ AND (’ . join(’ OR ‘, $cats) . ‘)’;</code></pre>fitting it in front of // Sections comment.
And finally, find <code>$query = “ FROM “ . PFX . “textpattern WHERE $status $posted $sections” ;</code>
and replace it with:
<pre><code>$query = “ FROM “ . PFX . “textpattern WHERE $status $posted $sections $categories” ;</code></pre>
I think that’s it.
P.S. These changes are only for article_menu. I don’t need the section_menu so I haven’t tried it with it.
Offline
#64 2005-09-08 06:06:40
- Vitruvius
- Plugin Author
- Registered: 2004-09-21
- Posts: 125
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
I am getting a slight problem with this plugin using TXP v4.0.1 (but I suspect it’s being the same since RC3)
The problem is to do with adding a link to Home. I add <code>default=“home”</code> and sure enough a link to home appears. But when I then add a sort attribute to the tag the Home link disappears. I have tried using <code>sort=“sect1,sect2”</code>, <code>sort=“home,sect1,sect2”</code> and <code>sort=“default,sect1,sect2”</code> but none will display the Home link. I am not using the <code>home=”“</code> attribute…
Would love some help.
Offline
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
> Vitruvius wrote:
> I am getting a slight problem with this plugin using TXP v4.0.1 (but I suspect it’s being the same since RC3)
> The problem is to do with adding a link to Home. I add <code>default=“home”</code> and sure enough a link to home appears. But when I then add a sort attribute to the tag the Home link disappears. I have tried using <code>sort=“sect1,sect2”</code>, <code>sort=“home,sect1,sect2”</code> and <code>sort=“default,sect1,sect2”</code> but none will display the Home link. I am not using the <code>home=”“</code> attribute…
I’m sorry, I thought I had this under control. I revisited it this morning and after 2 hours remain mystified by the problem. I’m not sure it worked ever, I think so. try
<code>
order=”.,sect3,sect2,sect1”
</code>
anyway, when I have more time i’ll straighten it out. the correct way to specify should be:
<code>
default=“home” order=“default,sect2,sect1”
</code>
Do you agree?
TV? Buglight for humans.
Offline
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
I’m not sure how broken ORDER was before but it’s better now.
specify order with section names, not titles, thusly and
<code>
order=“sect2,sect1”
</code>
and if you want to include the default/home page thusly:
<code>
default=“Home” order=“default,sect2,sect1”
</code>
note that ‘default’ is the pseudo section name.
see newstyle
http://publishingpipelines.com/ppl/rdt_dynamenus.php
or old:
http://publishingpipelines.com/ppl/rdt_dynamenus.txt
TV? Buglight for humans.
Offline
#67 2005-09-08 23:07:13
- Vitruvius
- Plugin Author
- Registered: 2004-09-21
- Posts: 125
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
Thank you for that. I was using version 0.6 – and upgrading to the latest using the php link above brought me to 0.7 which works as described.
You might want to (when you get a chance) update the textpattern.org entry as it is still listing 0.5 and linking to the .txt version…
Thank you again for your help!
Offline
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
> Vitruvius wrote:
> Thank you for that. I was using version 0.6 – and upgrading to the latest using the php link above brought me to 0.7 which works as described.
> You might want to (when you get a chance) update the textpattern.org entry as it is still listing 0.5 and linking to the .txt version…
You’re welcome.
I can’t sign in to textpattern.org; any suggestions?
TV? Buglight for humans.
Offline
#69 2005-09-13 10:18:35
- newnomad
- New Member
- Registered: 2005-06-11
- Posts: 5
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
I encountered a small problem:
The home link on top of the sections list doesn’t link to the default page, but to the homepage of the section it is currenly on.
what am I missing?
In source code all there is in the menu default li is an empty link tag,
while I expected to have the path of the homepage there
Last edited by newnomad (2005-09-13 10:45:34)
Offline
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
> newnomad wrote:
> I encountered a small problem:
The home link on top of the sections list doesn’t link to the default page, but to the homepage of the section it is currenly on.
what am I missing?
> In source code all there is in the menu default li is an empty link tag,
while I expected to have the path of the homepage there
huh.
send or post the emitted html code section mentioned above, the <txp:rdt_section_menu invocation, and if possible the url that has the problem.
TV? Buglight for humans.
Offline
#71 2005-09-13 13:07:41
- newnomad
- New Member
- Registered: 2005-06-11
- Posts: 5
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
sorry,
BBCode is turned off, can this be turned on?
ul id=“sections” class=‘menu office’
li id=“menu_default” a href=”“ home</a></li
li class=‘active’ id=“menu_section1” a href=”/section1” section1</a></li
li id=“menu_section2” a href=”/section2” section2</a></li></ul
txp is on a subdomain
a href=”“ shouldnt this be
a href=“sub.domain.com”
Offline
#72 2005-09-15 18:08:48
- sunmaker
- Member
- From: Washington DC
- Registered: 2005-01-04
- Posts: 40
Re: [plugin] [ORPHAN] rdt_dynamenus - automatic section and article menus
This marvelous plugin appears to add space above itself that I can’t attribute to the CSS in my site or any other cause. The TXP section list tag does not have this issue.
My plugin is:
txp:rdt_section_menu id=“sect” wraptag=“ul” break=“li” default=“Home” noshow=“Home” /
and my CSS is:
#sect
{padding-left: 20px;}
#sect ul
{list-style: none;}
#sect li
{display: inline; padding-right: 10px;}
Hmm.
Last edited by sunmaker (2005-09-15 18:10:11)
All boundaries are for practical purposes only.
Offline