Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-10-29 23:26:23

lozmatic
Member
From: Melbourne, Australia
Registered: 2006-08-27
Posts: 259
Website

Using a custom field for the ID value in a article_custom tag

I want to use a custom field to include a link from a blog post to any another article. This in a form

This will not work: <txp:article_custom id=”<txp:custom_field name=“custom2” />” lisform=“related article”>

I haven’t had much luck with asy_wondertag either.

Any suggestions?

Offline

#2 2007-10-30 00:05:18

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: Using a custom field for the ID value in a article_custom tag

Funny you should ask! :) I just wrote a little plugin last night for a site that does what you need. I haven’t uploaded it yet, so here it is:

# jmd_article_cf v0.1
# Creates an article_custom tag based on a custom field.
# Jon-Michael Deldin
# http://jmdeldin.com/

# ......................................................................
# This is a plugin for Textpattern - http://textpattern.com/
# To install: textpattern > admin > plugins
# Paste the following text into the 'Install plugin' box:
# ......................................................................

H4sIAAAAAAAAA61SyW7CMBA9k68YWZECEoUEShOZBlG1p0r9hsh4aVxlk+O0IMS/13bC1nNv
M8/z3pvFBEchPrY4xuibq1bWFVq3eIlROIts9IQR6XReK5tECUbvdfXwIWlOeAFvvGDSEYzI
UJd1SlpkYZBc6wbP518lc4UzWpdzVx1hxHhLlWz04Lh6xOhVcaJ5C6QCorSkBc9o1+q6BE0+
YUdazqA2bzCgQhrZmWUbsj40HK0lDvu0IiV3ViY2/tlFUAz1OS8aN+ACo+2z3jf4vgxErcoU
nQGbIaAiRb155swRzDfbQZDWzDkuErMzT3QVtbPBverYJ1q3E+/ojfheK0L1uHgxyJgoRQ5j
bzQKqAgg3UAQTG1mfa/5ZAq9wGTteSP/rCsZpHDbF9zo2U04BZ8KK3FPNYOmf7d9Q5asp16d
7rvybeSgQpZS951GwcVHcd2pCm7s1t7Js2tK+hNkivz83xnMvy3ZykVGb7VMGBVC7HZxHC7D
OOYhFTyhPFoKtgjNTzj9AkEuOqX/AgAA

Usage: <txp:jmd_article_cf cf="custom2" form="related_article" />

Alternatively, you can accomplish this with <txp:php> – see wet’s article. That’s essentially what my plugin does.

Offline

#3 2007-10-30 00:22:05

lozmatic
Member
From: Melbourne, Australia
Registered: 2006-08-27
Posts: 259
Website

Re: Using a custom field for the ID value in a article_custom tag

I was an atheist before your post!

Thank you – this is perfect.

Offline

Board footer

Powered by FluxBB