Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2006-04-28 01:56:33

marvix
Member
Registered: 2006-04-06
Posts: 27

Re: [archived] glx_hl_current highlight current article

How to make this work with categories ?

Offline

#17 2007-01-22 16:51:44

satsilem
Member
Registered: 2006-09-20
Posts: 19

Re: [archived] glx_hl_current highlight current article

The home page of this plugin doesn’t have anything can please someone provide another download link for this plugin?

It is exactly what I need for one of my projects

Thanks in advance

Offline

#18 2007-02-06 10:48:19

hazel
Member
From: Glastonbury, UK
Registered: 2006-09-22
Posts: 36

Re: [archived] glx_hl_current highlight current article

satsilem ~ Johan’s page is back up again.

To get this working with categories edit the plugin and add the following, which is just a small mod of the ‘section’ function:

function glx_hl_current_category($atts) 
{
	global $pretext;

	if (is_array($atts)) extract($atts);

	$category = (empty($category)) ? "" : $category;
	$class = (empty($class)) ? "current" : $class;

	$output = ' class="'.$class.'"';

	$categories = array_map("trim", explode(",", $category));

	$condition = in_array($pretext["c"], $categories);

	return ($condition) ? $output : "";
}

Offline

#19 2007-02-06 11:18:52

satsilem
Member
Registered: 2006-09-20
Posts: 19

Re: [archived] glx_hl_current highlight current article

Bookmarked, downloaded and I am going to test it right now!

Great!

Thank you for sharing the information

Offline

#20 2007-02-20 00:57:33

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,475
Website

Re: [archived] glx_hl_current highlight current article

Hi! It works great when a section is selected and I could make a separate page for every section so I can have a great navigation. But I wonder if there is any chance of detecting the current section in the output instead of having to state a particular section?

I’ve tried this kind of thing:<code>
<txp:article_custom section=”<txp:section />” form=“recent_article” sort=“Posted desc” /> </code> but it breaks.

It would be great if you could make it work!


Dozy P My attempt at music

Offline

#21 2007-02-20 01:27:27

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,475
Website

Re: [archived] glx_hl_current highlight current article

Re my last question, I just realised I could do this which isn’t much trouble at all:<code>
<txp:if_section name=“about”>
<txp:article_custom form=“recent_article” limit=“10” section=“about” sort=“Posted desc” /></txp:if_section>
<txp:if_section name=“contact”>
<txp:article_custom form=“recent_article” limit=“10” section=“contact” sort=“Posted desc” /></txp:if_section>
</code> etcetera

It works fine like that :-)

Cheers!


Dozy P My attempt at music

Offline

#22 2007-08-12 02:13:06

blumie607
Member
Registered: 2004-03-08
Posts: 175
Website

Re: [archived] glx_hl_current highlight current article

Hi,

I tried the code that was posted to add if_current_category to the plugin (found in this post, however it is not working for me.

Does anyone know why?
Thanks

Last edited by blumie607 (2007-08-12 02:14:26)


bludrop studios .::. Creative Expression

Offline

#23 2007-08-15 04:17:08

blumie607
Member
Registered: 2004-03-08
Posts: 175
Website

Re: [archived] glx_hl_current highlight current article

Well, I did some searching and I found the culprit. (at least a solution that works).

The original poster of the code simply copied the glx_hl_current_section code and replaced the [s]’s with [c]’s.

Since categories work slightly different than sections, I found that copying the glx_hl_current_article code worked better, because that referenced $pretext and $thisarticle.

Then, I just changed [id] and [thisid] with [c] and [category1]. I’m not sure if there is a way to do category 1 or 2 (there probably is), but I was satisfied with category1.

Below is the PHP I put in the plugin code.

function glx_hl_current_category1($atts) 
{
	global $thisarticle;
	global $pretext;

	if (is_array($atts)) extract($atts);

	$active = (empty($active)) ? 'current' : $active;
	$output = ''.$active.'"';

	if ($pretext["c"] == $thisarticle["category1"])
	{
		return $output;
	}
}

Help from this page: Accessing Global Variables in Textpattern

Last edited by blumie607 (2007-08-15 04:25:10)


bludrop studios .::. Creative Expression

Offline

#24 2008-01-25 08:05:04

simsim
Member
Registered: 2006-05-06
Posts: 70

Re: [archived] glx_hl_current highlight current article

Hello,

Does this plug-in work with clean URLs? I’ve used it in both __misc__-type and __article__-type forms to no avail.

Last edited by simsim (2008-01-25 08:05:23)

Offline

#25 2008-01-25 16:25:09

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [archived] glx_hl_current highlight current article

Yes it does. I’ve used it like this:

On the page: <txp:article_custom section="blah" form="article_title_menu" />

Article form ‘article_title_menu’:

<li>
<a<txp:glx_hl_current_article class="active" /> href="<txp:permlink />"><txp:title /></a>
</li>

Last edited by els (2008-01-25 16:25:56)

Offline

#26 2008-02-07 09:37:13

castanet
Member
From: Oxford
Registered: 2005-03-19
Posts: 97

Re: [archived] glx_hl_current highlight current article

Hi – thanks for a great plugin. Can anyone help me with a related css problem?

Here you can see I have got the plugin working for the top four articles in that section. However, I need to apply styles to each list item it produces to get the colour effect in the original navigation panel below.

Any ideas, anyone?

My form and code are exactly as in Johan’s example.

Thanks in advance

Last edited by castanet (2008-11-06 12:34:43)

Offline

#27 2008-02-11 14:23:35

castanet
Member
From: Oxford
Registered: 2005-03-19
Posts: 97

Re: [archived] glx_hl_current highlight current article

Well, I got it to do the job by calling each article individually on the template and then giving each one a separate form with the plugin and a class attached to the permlink. It works, but not ideal. Any further help would be welcome.

Offline

#28 2008-11-05 11:18:14

castanet
Member
From: Oxford
Registered: 2005-03-19
Posts: 97

Re: [archived] glx_hl_current highlight current article

All links to this excellent plugin and/or its creator appear to be dead. Any ideas where I can find it again?

Offline

#29 2008-11-05 13:19:07

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,369
Website GitHub Mastodon Twitter

Re: [archived] glx_hl_current highlight current article

Check out this post


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#30 2008-12-13 19:09:31

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: [archived] glx_hl_current highlight current article

hmmm, not working for me over here. i was wondering if anyone could look at my code?

<ul id="navlist" break="li" wraptag="ul">
<h2>
<li<txp:glx_hl_current_section section="contact" class="active" />><txp:section name="contact">Contact</txp:section></li>
<li<txp:glx_hl_current_section section="bio" class="active" />><txp:section name="bio">Bio</txp:section></li>
<li<txp:glx_hl_current_section section="blog" class="active" />><txp:section name="blog">Blog</txp:section></li>
</h2>
</ul>

i’ve tried a few different “class=” options. in my css i have a declaration for a:hover so i’d like to have this plugin inject the hover style into my navbar

#navlist li {
display: inline;
float: right;
font-family: helvetica, arial, sans-serif;
font-size:1.3em;
text-transform: lowercase;
margin-left:10px;
}
#navlist a:hover{
color:#627785;
text-decoration:underline;
}

Last edited by mrtunes (2008-12-13 19:10:03)

Offline

Board footer

Powered by FluxBB