Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#61 2006-04-24 20:34:54
- marvix
- Member
- Registered: 2006-04-06
- Posts: 27
Re: [plugin] [ORPHAN] ako_nav
Hi ..
How to use this plugin to list categories .. I have problem with the active stata style !
Offline
Re: [plugin] [ORPHAN] ako_nav
Marvix, could you give some more information as to your problem. It’s kind of hard to help you fix an issue without knowing at all what is going on. What’s the website that you’re trying to run this on? How are you calling the plugin on your pages? Do you haved the .active {} styles in your CSS?
Offline
#63 2006-04-25 05:14:07
- marvix
- Member
- Registered: 2006-04-06
- Posts: 27
Re: [plugin] [ORPHAN] ako_nav
The problem …
I have category called toplinks … under it there is another sub … works fine … but the .active{} always is the 1st category style … doesn`t change based on the selected category .. you may test this to see it .
am working on the localhost yet … after weeks will be done 1st txp site :)
btw. I had copyed the category_list function from txp, and with some modifycation works now as I need :)
<code> function my_category_list($atts) // output href list of site categories { global $pretext , $siteurl;
$selected_cat= $pretext[‘c’]; extract(lAtts(array( ‘label’ => ‘’, ‘break’ => br, ‘wraptag’ => ‘’, ‘parent’ => ‘’, ‘type’ => ‘article’, ‘class’ => FUNCTION, ‘labeltag’ => ‘’, ‘activeclass’=>’‘, ‘showhome’=>0, ‘homelinktitle’=>‘Home’,),$atts));
if ($parent) { $qs = safe_row(“lft,rgt”,‘txp_category’,“name=’$parent’”); if($qs) { extract($qs); $rs = safe_rows_start( “name,title”, “txp_category”,“name != ‘default’ and type=’$type’ and (lft between $lft and $rgt) order by lft asc” ); } } else { $rs = safe_rows_start( “name,title”, “txp_category”, “name != ‘default’ and type=’$type’ order by name” ); }
if ($rs) {
$out = array();
$out[]=”<a href=‘http://$siteurl’>$homelinktitle</a>”;
while ($a = nextRow($rs)) {
extract($a);
if ($name 'root') continue;
(strtolower($selected_cat) strtolower($name)) ?
$active_class = “ class=’$activeclass’ “ : $active_class =’‘;
if($name and $name !=$parent)
$out[] = tag(str_replace(“& “,”& “, $title),‘a’,’ href=”’.pagelinkurl(array(‘c’=>$name)).’”’ . $active_class); } if (count($out)) {
return doLabel($label, $labeltag).doWrap($out, $wraptag, $break, $class);
}
}
return ‘’;
}
</code>
all wht i need to give the main to list the sub … you may add this option to u code also … what if I have alot of sections or categories … write one by one … taking time ;)
Offline
Re: [plugin] [ORPHAN] ako_nav
1) sorry fo my English
2) sorry for my teapot-brain :)
class=“active” not works, when section names contains character in upper register
(like this – “/1S_intro”)
when I renamed section names to lower register (like “1s_intro”) class=“active” began working
why this is, I don’t know, but I think that info could be useful for plugin users and author
Offline
Re: [plugin] [ORPHAN] ako_nav
Interesting Marazmus. I’ll take a look into it in the coming days. Kind of busy at the moment, but it’s on the “to-do” list…
Marvix, I’ll definately consider looking into throwing that code in. As I’ve said, I’m kind of busy, but I’ll see what can be done.
Offline
#66 2006-04-28 11:15:27
- marvix
- Member
- Registered: 2006-04-06
- Posts: 27
Re: [plugin] [ORPHAN] ako_nav
Can this be used for categories ?!!?
Offline
Re: [plugin] [ORPHAN] ako_nav
Marvix, I think it should be able to work with categories. Can’t say I’ve tried it out, but I see no reason as to why it shouldn’t.
An automatic category listing is definately a consideration for the next release. Is any one else interested in this??
Offline
Re: [plugin] [ORPHAN] ako_nav
I would be interested for sure. So count me in. I like to keep my plugin dependence to a minimum, and being that this is now one of the first plugins I install on a site the addition of cats would be great.
Offline
#69 2006-04-29 08:18:07
- marvix
- Member
- Registered: 2006-04-06
- Posts: 27
Re: [plugin] [ORPHAN] ako_nav
akokskis …. test many ways .. even with small modification with ur code ,,, didn`t work for me when browesing categories !
I had test this code ,,, but I have problem with the function return .. don`t know how to slove it ( am not php guru :)) ..
<code>
function hl_current_cat($atts)
{
global $pretext;
if (is_array($atts)) extract($atts); $Category=$pretext[‘c’]; $class = (empty($class)) ? “current” : $class; $output = ‘ class=”’.$class.’”’;
$rs = safe_rows_start( “name,title”, “txp_category”, “name != ‘default’ and type=‘article’ order by name”);
if ($rs) { $c=0; while ($a = nextRow($rs)) { if($Category $a['name']) { $N=$a['name']; $c=1; break; } } } // if(in_array($Category, $names)) { break;return $output; }else{ return "";} if($N $Category) { return $output; }else{ return “”;}}
</code>
once the term is true … will return for all true … this the problem :)
Offline
#70 2006-06-19 05:09:43
- bbrcn
- New Member
- Registered: 2006-06-17
- Posts: 6
Re: [plugin] [ORPHAN] ako_nav
Hi, first,please forgive the newbie if i asked anything stupid.
I just installed Serene template. It comes with the ako_nav so I installed it. After the installation my achive, about, contact can’t show up. Only “the page cannot be found”. but all the articles are OK. I have checked several times couldn’t figure out what’s the problem. The only thing I can guess is my server doesn’t support clean url, I’m using mess url now. Anybody can give me solution? Thank you!!
Offline
#71 2006-06-19 05:44:37
- bbrcn
- New Member
- Registered: 2006-06-17
- Posts: 6
Re: [plugin] [ORPHAN] ako_nav
If I type http://*****/index.php?s=archive rather than http://******/archive the page will show up. Does the information help?
Last edited by bbrcn (2006-06-19 05:45:17)
Offline
Re: [plugin] [ORPHAN] ako_nav
Can you give me the actual URL to take a gander at?
Offline