Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Automatically numbered footnoted credit, if applicable
I’m about to start running micro-blogs on my site, some of the tip-offs for which will (hopefully) be sent in by readers of the site. For those instances, I want to credit those tipsters’ names along the bottom of the relevant page, referenced by a number on the article.
Doing this with a txp:article_id
in x and y forms and two txp:article
tags with form="x"
and "y"
tags on the page is a doddle, of course, but being the difficult chap that I am, I want numbers starting with 1 on each page of 40 blogs, and only numbering those articles with a tipster custom_field
filled in. So if only 4 of the 40 are from tips, I want those blogs to show numbers 01, 02, 03 and 04, with the tipsters credited 01, 02, 03 and 04 in that second txp:article
bit, and the next page of 40 restarting from 1.
I’d bet my house there’s a simple txp:php
solution for this, probably to be embedded within a txp:if_custom_field
in form x and something calling it in y; if only I were clever enough to know simple php.
Thanks all.
Hicks, no relation to John, name thought-of before I’d heard of JH
Offline
Re: Automatically numbered footnoted credit, if applicable
You could use rvm_privileged to supply the logged in user when making new entries with smd_query. Also when making requests with smd_query. That’s the combo I’d read on at first. Hope that helps a bit. Not sure how I would do/try that.
txtstrap (Textpattern + Twitter Bootstrap + etc…)
Offline
Re: Automatically numbered footnoted credit, if applicable
Thanks Josh.
I was hoping, or thinking, it wouldn’t need a plugin. Is there a way, anyone?
Ta.
Offline
Re: Automatically numbered footnoted credit, if applicable
Did I just lose my house?
Offline
Re: Automatically numbered footnoted credit, if applicable
Would the txp:if_different
tag help? If you used against txp:author
to isolate them so that you can sort and number as needed based on any custom fields.
txtstrap (Textpattern + Twitter Bootstrap + etc…)
Offline
Re: Automatically numbered footnoted credit, if applicable
All right, I think I’ve figured out a way. This is in my x form:
<txp:adi_calc name="whatnotno" value='<txp:variable name="whatnotno"/>' add="1"/>
<txp:variable name='<txp:article_id/>' value='<txp:variable name="whatnotno"/>'/>
<txp:variable name='<txp:article_id/>'/>
and in my y:
<txp:variable name='<txp:article_id/>'/>
Seems to work in rudimentary tests, without my custom fields (which as I look at them now I can’t add to… another search for me). Perhaps I am learning something after all.
Offline
Re: Automatically numbered footnoted credit, if applicable
another search for me
Post back. Love to see what comes next. Seems useful for sites with lots of authors as I’m tied too now. Did the if_different
tag not have any potential use in your predicament?
Last edited by whaleen (2010-03-17 04:25:28)
txtstrap (Textpattern + Twitter Bootstrap + etc…)
Offline