Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-03-15 20:13:18

hicks
Member
From: Portland, OR, USA (ex-UK)
Registered: 2009-05-08
Posts: 106
Website

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

#2 2010-03-16 01:32:45

whaleen
Member
From: Portland
Registered: 2006-05-11
Posts: 373
Website

Re: Automatically numbered footnoted credit, if applicable

rvm_privileged & smd_query

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

#3 2010-03-16 02:08:45

hicks
Member
From: Portland, OR, USA (ex-UK)
Registered: 2009-05-08
Posts: 106
Website

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

#4 2010-03-16 19:54:46

hicks
Member
From: Portland, OR, USA (ex-UK)
Registered: 2009-05-08
Posts: 106
Website

Re: Automatically numbered footnoted credit, if applicable

Did I just lose my house?

Offline

#5 2010-03-16 20:23:45

whaleen
Member
From: Portland
Registered: 2006-05-11
Posts: 373
Website

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

#6 2010-03-16 23:04:50

hicks
Member
From: Portland, OR, USA (ex-UK)
Registered: 2009-05-08
Posts: 106
Website

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

#7 2010-03-17 04:24:47

whaleen
Member
From: Portland
Registered: 2006-05-11
Posts: 373
Website

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

Board footer

Powered by FluxBB