Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Can't figure out Sticky and Live Scenario
>Mary wrote
How so?
Ok, so I think two completely independant article flows is problematic.
Let’s say I want the top article (sticky, if there is one, otherwise the first live one of the article flow) to use one form, and have all other articles in the flow use a different form. Pretty simple really, it’d just be nice to have a sticky item pop up to the top of a regular old article list.
You can’t do that with two separate (sticky/live) article tags, unless I’m mistaken.
BTW I was after 5 total articles in my example and not 9
Last edited by mrdale (2007-03-21 03:41:27)
Offline
Re: Can't figure out Sticky and Live Scenario
Certainly the sticky and live can cause headaches when you need to display a list of X articles with Y sticky ones on top and Z live ones following. It gets even more complicated if this list is to be shown unafected by section, category or search, i.e. on pages with conditions set.
To clarify this an example might be useful, e.g. a simple web site maintaining a list of the latest 5 articles in a ‘sidebar’ showing their posted date, title and category. This ‘sidebar’ has to be shown on every page the site can display. Now for this to work, one has to build several nested conditional tags, each containing the same code for output – loads of repetition – because if for example a user browses a category then the article list will only output the articles in that particular category.
Now, if we want the to first entries in the list to be “glued”, one would expect to set their status to sticky. Wrong! This will not solve a thing, unless we add an additional <txp:article status="sticky" limit="2" />
and correct our previous tag to only output 3. But what then if there is only one article marked sticky? Yup, then our entire assemled list will only have 4 entries and not 5 as we originally intended. But that’s peanuts – it gets worse!
Lets say all these articles are in a section called, “article”, which when rendered uses a traditional article tag followed by a <txp:if_individual_article>
block. Here a sticky article is not outputted, so again we’d have to add some compensation code (repetition) that checks status for sticky.
It seems rather heavy, and “sticky” seems to be a misleading word in the context of the usage guide on wiki – static would seem to be more appropriate IMHO, which leads to the end, a true status called: “pin/glue/sticky” is needed, that automatically provides the functionality of being top the list.
Sorry for cryptic way of getting to this end – hope you understand me though.
Never make the same mistake twice… there are so many… try a new one each day!
Offline
Re: Can't figure out Sticky and Live Scenario
I think this is just too complicated to be captured in just one plugin. You can always use custom php code (as in this case).
Offline
Re: Can't figure out Sticky and Live Scenario
Psilo wrote:
To clarify this an example might be useful, e.g. a simple web site maintaining a list of the latest 5 articles in a ‘sidebar’ showing their posted date, title and category. This ‘sidebar’ has to be shown on every page the site can display. Now for this to work, one has to build several nested conditional tags, each containing the same code for output – loads of repetition – because if for example a user browses a category then the article list will only output the articles in that particular category.
Did you try with txp:article_custom?. It’s section/category insensitive.
Last edited by maniqui (2007-03-21 15:12:50)
Offline
Re: Can't figure out Sticky and Live Scenario
I agree with psilo.
I think the approach of making a (or x-number of) sticky articles pin to the top of an article flow (if specified) is a much simpler, much more intuitive apporach. I think there could be a way to implement it too (attribute wise) while staying backward compatible.
I think if you hacked the existing article tag to allow status=“sticky,live” limit=”#_sticky_articles,#_live_articles” it’d do the trick…
Last edited by mrdale (2007-03-21 14:50:08)
Offline
#18 2007-03-22 23:13:58
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Can't figure out Sticky and Live Scenario
BTW I was after 5 total articles in my example and not 9
…if you hacked the existing article tag to allow…
Dale, you said (emphasis mine):
- I want to have one sticky article (output with form “A”) at the top of the page if one exists, followed by 5 live articles (output with form “B”) otherwise…
- I want to display the first of the 5 live articles (output with form “A”) followed by the next 4 articles (output with form “B”)
…where status=“sticky,live” limit=“1,5” would produce 1 sticky article at the top of an article flow followed by 5 live articles in the same flow.
To which I replied (clarification in parenthesis added):
It (your suggested solution) would still, in that situation (no sticky existing), (your suggested solution would) return merely 5 live articles and not the 9 desired.
In other words, it would act more like how we understand “sticky”, but it would not resolve your particular need as described.
What you want, in fact, is an “if_sticky_article_exists” tag.
…“sticky” seems to be a misleading word in the context…
I agree.
Offline
Re: Can't figure out Sticky and Live Scenario
God, I can’t believe I’m so careless with these posts. My mistake. #2 is just sick and wrong.
Let me clarify one more time what I’d like to be able to do…
The desired result:- An article list with five or so articles.
- The top article get’s “formA” the rest get “FormB”.
- If there are sticky articles, I want to select the top article (from the sort criteria) and put it in position #1
- If not, I want the first live article to take position #1
- status=“sticky,live”
- limit=“1,4”
- would produce the list I described above.
<txp:if_first_article>FormA stuff<txp:else/>FormB stuff</txp:if_first_article>
Hopefully that’s clearer. I do think that’s a more intuitive behavior than using separate tags. I think there’s a need to be able to pin one or more articles to the top of a flow, without having to use two tags. And it wouldn’t have to affect the existing tag behavior.
Offline
#20 2007-03-23 01:14:55
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Can't figure out Sticky and Live Scenario
- is just sick and wrong.
ROFLOL
Thanks Dale, that makes more sense. :)
I’m not sure if it follows, as Frederik (Psilo) pointed out, with what Textpattern now seems to think what “Sticky” means. Sticky articles aren’t included in feeds, for example. Because of that, it makes sense that they be separate. “Static” does seem to be more of what they are, intended not for giving certain articles prominence in a list, but for powering static pages.
To me it makes sense that a sticky article be identical to regular articles only listed first, whereas a static article doesn’t show up in feeds and has no individual permalink (use it on an About, Contact, Search page, etc).
The good news is, Txp will be moving in that sort of direction with 4.1.x. It’s not likely to change in 4.0.x because we really don’t want any more drastic changes in that branch if we can help it. With 4.1 we can make Txp act a lot more logically, because we aren’t tied to doing it the way its always been done.
Offline
Re: Can't figure out Sticky and Live Scenario
maniqui wrote:
Did you try with txp:article_custom?. It’s section/category insensitive.
Yes, that is the way to get around that issue. Thanks for putting that to my attention. Actually in my “real world” implementation, it was built with <txp:article_custom>
, but just wrote the post as an example.
He he… real world implementation… who am I kidding – THIS IS CYBERSPACE!!!
Never make the same mistake twice… there are so many… try a new one each day!
Offline
Re: Can't figure out Sticky and Live Scenario
With 4.0.4 “sticky” became somehow “sick and wrong”. As explained in the dev forum tcp:meta_keywords doesn’t work with sticky articles, sticky articles must explicitly be mentioned by having two txp:article tags, the wonderful Plug-In tru_tags doesn’t show sticky articles on tag search result pages, …
Mary, I follow you … sticky articles should be identical to regular articles. But ‘static’ articles should also have a permalink and they should also trigger i.e. pings when changed or created.
For creating real static pages txp:output_form is sufficent IMHO.
Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML
Offline
Re: Can't figure out Sticky and Live Scenario
I’d never realised it, but I regularly use stickies to create both static pages and ‘featured’ articles…
I’ve recently run into problems becuase ‘featured’ stickies don’t appear in feeds, or in article lists generated by rss_suparchive and tru_tags.
The ability to distinguish between ‘static’ and ‘featured’ articles would be very useful – especially if ‘featured’ items could then be integrated with live articles better than stickies currently do.
merz1 wrote:
For creating real static pages txp:output_form is sufficent IMHO.
In my experience using forms for static content is fine for personal sites, but not really appropriate for clients, many of whom would cause havock if I gave them access to the forms tab :-o
Offline
Re: Can't figure out Sticky and Live Scenario
pieman wrote:
In my experience using forms for static content is fine for personal sites, but not really appropriate for clients, many of whom would cause havock if I gave them access to the forms tab :-o
Or you could just reference articles explicitly. I gave up on using status=“sticky” with static content, because there are just too many problems with it. Instead I use an absolute reference to an article id.
What seems to make the most logical sense is the following behavior… An article tag that produces one article flow able to contain both “sticky” and “live” with independent limits for each and where sticky pops up top.
Offline