Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Article on index page only.
I want to make a intro article that will be placed in a DIV on the main page. I do not what it to show on any other page. I am having difficultly doing this.
Offline
Re: Article on index page only.
This should work:
<code>
<txp:doArticle id=“232” />
</code>
Where 232 is the id of the article you want to show. Then tuck that article away somewhere where it can not be found manually (meaning a section that does not get searched) and voila. Achieved goal!
Plugins: ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1
“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu
Offline
Re: Article on index page only.
Ok. Got all that. Made a new section this is checked for main page and non-searchable. Looks like it is working. Thanks. This is not in the textbook guide.
Why would I use doArticle instead of just article?
(just trying to learn the ins and outs)
Offline
Re: Article on index page only.
Hmm .. Does article nowadays support id? I’ve been away so haven’t really kept up with the TXP development for almost six months so. Might work with txp:article id=”“ too ..
Plugins: ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1
“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu
Offline
#5 2005-06-01 21:24:37
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Article on index page only.
Yeah, we don’t use doarticle anymore, just
<txp:article_custom id="" />
Offline
Re: Article on index page only.
I learn something new everyday right now. Lovely. But only article_custom not article?
Plugins: ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1
“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu
Offline
#7 2005-06-02 20:09:08
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Article on index page only.
Yes, for article it works too.
Offline
Re: Article on index page only.
What about setting the article to sticky and doing: <code><txp:article status=“sticky” /></code> that way you aren’t limited to just that specific article id.
Just another option.
Refresh Dallas and other Refreshing Cities.
Offline
Re: Article on index page only.
tinyfly,
Well, if moloko then adds more then one sticky article to other sections then the “hidden” one there will be a problem on the main page, right?
Plugins: ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1
“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu
Offline
Re: Article on index page only.
Your right, that is when the ob1_if_section comes in handy.
Refresh Dallas and other Refreshing Cities.
Offline
Re: Article on index page only.
Hehehehehe .. Watch my fingers with that ruler tinyfly!
Here I am preaching and I’ve done a plugin that can solve it. Lovely ;)
Plugins: ob1_advanced_search 1.032b, ob1_search_score 1.0, ob1_pagination 2.5, ob1_title 4.1, ob1_modified 2.1
“Let your plans be dark and as impenetratable as night, and when you move, fall like a thunderbolt.”
— Sun Tzu
Offline
#12 2005-06-05 00:36:15
- zem
- Developer Emeritus

- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: Article on index page only.
You should be able to use both the id=123 and status=sticky attributes simultaneously. Setting the articles to Sticky status will keep them out of the regular article lists, and id will let you select which one to display on the front page.
Also, <txp:article status=sticky /> ought to respect the ‘On Front Page’ setting for each section. If you have On Front Page set to No, then sticky articles in that section won’t (shouldn’t – I haven’t tested this) show up on the front page.
Alex
Offline
Re: Article on index page only.
On a similar note, I have a “sticky” article that I want to have remain on my front page. It does not appear in my article list below the article. However, when I click on my link for More Articles <txp: older>, it takes me to Page 2 of the default page and my “sticky” article still appears. How do I get this article to only appear on the front page? I thought I had this working before I upgraded to 4.0.1 Maybe not.
Site: walkableneighborhoods.com
Current code:
Hmm, guess I can’t post my code…
Any help appreciated, thanks!
Last edited by sunnyd503 (2005-10-22 05:42:48)
Offline
Re: Article on index page only.
I made a temporary fix in my site, so you may not be able to see what I’m talking about. I have linked my More Articles link to my Archives page, but on my Archives page I do not have exerpts from the articles, only links. I liked having those exerpts like on “Page 2”. I just didn’t want the sticky article appearing at the top of each subsequent page.
By the way, I have read through the TXP resources out there and tried a number of combinations and none of them seem to work.
Offline
#15 2005-10-23 00:41:50
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Article on index page only.
Its because sticky articles do not account for pages.
Use pastebin to post code if you have troubles posting it to the forum.
I don’t know of any built-in/plugin solution (though that doesn’t mean there isn’t one), but I know you can use straight PHP to work around this. If you could post the tag/parameters you’re using for your sticky article, I/someone else can show you how to go about it. :)
Offline