Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: [plugin] [ORPHAN] zem_link
Offline
#77 2006-05-09 12:25:46
- Logoleptic
- Plugin Author

- From: Kansas, USA
- Registered: 2004-02-29
- Posts: 482
Re: [plugin] [ORPHAN] zem_link
Rock and roll. You just made my week. :-)
Offline
#78 2006-08-19 19:09:50
- jrphelps
- Member

- From: Fort Worth, TX
- Registered: 2006-07-13
- Posts: 30
Re: [plugin] [ORPHAN] zem_link
Sorry to bump an old thread, but I want to use a custom field for inputting a link ID for a form like this:
<txp:zem_link linkid="<txp:custom_field name="fieldname"/>"/>
Any way to achieve this?
Last edited by jrphelps (2006-08-19 19:10:36)
Offline
#79 2006-08-19 21:30:31
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: [plugin] [ORPHAN] zem_link
In your article form:
<txp:php>
global $thisarticle;
echo zem_link(array(
linkid => custom_field(array('name' => 'fieldname'))
));
</txp:php>
:)
Offline
#80 2006-08-20 02:17:34
- jrphelps
- Member

- From: Fort Worth, TX
- Registered: 2006-07-13
- Posts: 30
Re: [plugin] [ORPHAN] zem_link
Mary, that worked for outputting the anchor tag, but the anchor text does not output automatically with this code. If I use <txp:zem_link linkid="5" /> it outputs the name of the link as the linked text. I tried looking at the code, but I couldn’t see what was making the difference.
Offline
Re: [plugin] [ORPHAN] zem_link
Recheck if you properly replaced fieldname with the name of the custom field you wanted to use (not custom_3, but the real name as set via preferences).
Works here as described. If this is wrong, zem_link will output an empty <a href="..."></a> element linking to the current article.
Last edited by wet (2006-08-22 04:10:09)
Offline
#82 2006-08-21 16:45:31
- jrphelps
- Member

- From: Fort Worth, TX
- Registered: 2006-07-13
- Posts: 30
Re: [plugin] [ORPHAN] zem_link
wet: I think I did, but here is my code for your amusement reference:
<code><strong><txp:if_article_list><txp:permlink><txp:posted format=”%B %e” /> | <txp:title /></txp:permlink><txp:else /><txp:posted format=”%B %e” /> | <txp:title /></txp:if_article_list></strong><br />
<txp:if_article_list>
<txp:excerpt />
<txp:else />
Rain Crow will play at <txp:php>
global $thisarticle;
$a = custom_field (array (‘name’ => ‘Venue Link ID’));
echo zem_link(array(‘linkid’ => $a));
</txp:php> on <txp:posted format=”%A, %B %e” />.<br />
<txp:body />
</txp:if_article_list></code>
If you see anything wrong with that, by all means let me know!
Last edited by jrphelps (2006-08-21 16:48:49)
Offline
Re: [plugin] [ORPHAN] zem_link
jrphelps wrote:
<txp:if_article_list><txp:permlink><txp:posted format="%B %e" /> | <txp:title /></txp:permlink><txp:else /><txp:posted format="%B %e" /> | <txp:title /></txp:if_article_list></strong><br />
<txp:if_article_list>
<txp:excerpt />
<txp:else />
Rain Crow will play at <txp:php>
global $thisarticle;
$a = custom_field (array ('name' => 'Venue Link ID'));
###
echo 'here:'; dmp($a); echo ':there';
###
echo zem_link(array('linkid' => $a));
</txp:php> on <txp:posted format="%A, %B %e" />.<br />
<txp:body />
</txp:if_article_list>
Let’s get curious! What is printed by dmp() ?
Offline
#84 2006-08-21 19:18:08
- jrphelps
- Member

- From: Fort Worth, TX
- Registered: 2006-07-13
- Posts: 30
Re: [plugin] [ORPHAN] zem_link
OK, it didn’t output anything. I know my field name is correct. I’m not sure what else to check.
Edit: wet, you were right, it is outputting the permlink for the article rather than the link I am after.
Last edited by jrphelps (2006-08-21 19:23:24)
Offline
#85 2006-08-22 00:49:28
- jrphelps
- Member

- From: Fort Worth, TX
- Registered: 2006-07-13
- Posts: 30
Re: [plugin] [ORPHAN] zem_link
OK, here’s something interesting. Here are two links. The first one doesn’t display anything for $a. This is for linkid => 11. The second one says it can’t find the link for linkid => 12 although it displays 12 for dmp($a).
Edit: Had to remove the links because I had to change the form.
Last edited by jrphelps (2006-08-25 04:15:04)
Offline
#86 2006-08-25 04:11:02
- jrphelps
- Member

- From: Fort Worth, TX
- Registered: 2006-07-13
- Posts: 30
Re: [plugin] [ORPHAN] zem_link
Sorry to bump, but I really need some help with this.
I figured out that that the difference between link 11 and 12 was that 12 did not have <code>http://</code> in front. When I added that, it quit displaying the link id.
Last edited by jrphelps (2006-08-25 04:18:11)
Offline
Re: [plugin] [ORPHAN] zem_link
I might help if you allowed me to access the inner workings. I admit, I have no idea what to suggest next having only the information from this thread.
Last edited by wet (2006-08-25 04:24:21)
Offline
#88 2006-08-25 04:26:51
- jrphelps
- Member

- From: Fort Worth, TX
- Registered: 2006-07-13
- Posts: 30
Re: [plugin] [ORPHAN] zem_link
What do you need from me? I don’t mean to be difficult.
Offline
Re: [plugin] [ORPHAN] zem_link
Looks like smf_eventarticle does not set custom fields. Also, some versions of PHP 4.4.2 are apparently differing from PHP 5 behaviour when parsing strings which is covered with v0.6.1.
Offline
#90 2006-08-25 19:20:04
- jrphelps
- Member

- From: Fort Worth, TX
- Registered: 2006-07-13
- Posts: 30
Re: [plugin] [ORPHAN] zem_link
wet, thanks again!
Offline