Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Recent articles excluding the present one
I don’t recall seeing a tag for presenting a list of recent articles excluding the present one when on an individual article page. Does anyone have a great idea of how to overcome this?
Currently, I have three design articles (portfolio pieces) I want to showcase.
When I am on the indi article page of any one of these I want to show the other two in a list form in a separate div.
If there are more (say five), I will show four.
Clearly, offsets won’t work here, because they are about chronology vs. similarity.
I suppose txp:related_articles would be a good choice, but it doesn’t use forms. I tried rss_unlimited_categories_related_list, thinking it would be appropriate, but it is more about listing articles according to their category ( a good choice for section/cat/title urls ).
Ultimately I would like the list below the indi_article to be “most recent” and “related by section or category” and exclude the article in focus.
Any thoughts?
- I am Squared Eye and I
am launchinghave launched Pattern Tap
Offline
Re: Recent articles excluding the present one
there is the glx_hl_current which highlights the article you are viewing. What if the css of that plugin were to be edited so as to allocate a display:none rule to the current article in the list.
Last edited by colak (2007-02-11 10:37:06)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: Recent articles excluding the present one
I surely did it with a related_article plugin, few moths ago for a client, but I had to modify the code.
It involved a comparison between the id of current article and the id of the article being inserted in the list. It’s quite easy to do, I’m not a programmer, but obviously I think this functionality should be implemented in standard txp articles tags (article_custom and recent_articles, at least).
If you want I could search in the code I modified, even if I wanted related, not recent. Still the problem is the same.
Let me know if I can help.
Z-
Offline
Re: Recent articles excluding the present one
ma_smith wrote:
I suppose txp:related_articles would be a good choice, but it doesn’t use forms.
According to the blurb, chh_related_articles does.
Offline
Re: Recent articles excluding the present one
Wet,
heydi hidy ho.
I have a feeling the chh_related_articles is not working nicely with rss_unlimited_categories, and I’ve noticed that the CHH plugins aren’t supported any longer. Takahasha hasn’t answered any of those threads for quite some time.
Any other ideas, and/or do you have any idea how to adjust chh_related to respond to Robs plugin?
or add “form” to the txp related tag, in txp:php form.
:)
Matthew
- I am Squared Eye and I
am launchinghave launched Pattern Tap
Offline
#6 2007-02-15 22:00:23
- anoke
- Archived Plugin Author
- Registered: 2006-04-15
- Posts: 152
Re: Recent articles excluding the present one
*bump*
Got a solution/workaround?
@M, (let’s play excluding that one link isn’t necessary) could you use article_custom instead of related articles?
Last edited by anoke (2007-02-16 17:00:09)
- When chickens are cold, they roost in trees; when ducks are cold, they plunge into water -
Offline
#7 2007-02-18 13:50:22
- anoke
- Archived Plugin Author
- Registered: 2006-04-15
- Posts: 152
Re: Recent articles excluding the present one
What do you mean with “by section or category”? I don’t get how the relation should go. :(
I’ve been using in individual article form article_custom (it gets current cat and section with wondertag) with a form containing:
<txp:asy_wondertag>
<txp:if_article_id id="<txp:page_url type="id" />">
<span style="background-color:red;"><txp:title /></span><br />
<txp:else />
<txp:permlink><txp:title /></txp:permlink><br />
</txp:if_article_id>
</txp:asy_wondertag>
So it highlights the current article without linking it. Leaving the <span> line away would exclude that link altogether..
I’m not sure if that was of any help :P
- When chickens are cold, they roost in trees; when ducks are cold, they plunge into water -
Offline
Re: Recent articles excluding the present one
anoke,
Currently article_custom doesn’t have anything that works toward exclusion. Thanks for the thought though. I can’t currently see a use for asy_wondertag here, though my logic might be evading me.
I am looking to display articles related to each other, using a form, I prefer articles that are related by section rather than category. I can use rss_unlimited_categories to some degree, but when you use that as a tagging system rather than for display purposes, it becomes awkward.
:)
Matthew
- I am Squared Eye and I
am launchinghave launched Pattern Tap
Offline
#9 2007-02-18 19:58:40
- anoke
- Archived Plugin Author
- Registered: 2006-04-15
- Posts: 152
Re: Recent articles excluding the present one
Shouldn’t rss_unlimited_categories_related do most of the job after it’s told the section of currently viewed article? <txp:rss_unlimited_categories_related section="<txp:section />"/>
? (i haven’t used unlimited categories that much..)
Anyway. Formwise if you can get any list containing currently viewed article, you can ‘skip’ (exclude) viewing that very article in the list. IMHO the bigger problem is satisfying the relations than viewing article links.
(i think i’ll mail you a screenshot tomorrow.. words & 1000 images etc.. it might be we’re talking about two different things still..)
Last edited by anoke (2007-02-18 20:01:12)
- When chickens are cold, they roost in trees; when ducks are cold, they plunge into water -
Offline
Re: Recent articles excluding the present one
ptv_if gives you a way to compare the output of two plugins and create if/else/elseif scenarios. might be a way to use this in your custom_article form (related links). Compare the article url of the page to the article url of the link in the list and not display it.
Just thinking out loud.
Offline
Re: Recent articles excluding the present one
hmm,
interesting thought Dale.
Good call. I’ll take a look.
- I am Squared Eye and I
am launchinghave launched Pattern Tap
Offline
Re: Recent articles excluding the present one
anoke,
If I’m not mistaken, the section attribute in rss_uc_related is a limiter, but it still needs a category tag to work properly, atleast it appeared so when I was getting errors without a category att.
:)
- I am Squared Eye and I
am launchinghave launched Pattern Tap
Offline