Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#73 2006-05-07 22:32:05

Logoleptic
Plugin Author
From: Kansas, USA
Registered: 2004-02-29
Posts: 482

Re: [plugin] [ORPHAN] zem_link

Hi Wet,

I’m having a lingering problem with zem_link. When I try to create a a link relative to the Textpattern root using <txp:zem_link href="foo/">bar</txp:zem_link>, I end up getting a link that’s relative to the current page instead. This was a problem with Zem’s v0.3 as well. A fix for this would help me a lot, since it would fix this problem.

Also, is it possible for you to update the listing for zem_link on Textpattern Resources? If not, how about releasing it as wet_link or zem_link_reborn?

Last edited by Logoleptic (2006-05-07 22:35:31)

Offline

#74 2006-05-08 04:22:14

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: [plugin] [ORPHAN] zem_link

Logoleptic wrote:

When I try to create a a link relative to the Textpattern root using <txp:zem_link href="foo/">bar</txp:zem_link>, I end up getting a link that’s relative to the current page instead.

I will look into it and amend it when possible. At least according to the documentation, it should work as you expect.

Offline

#75 2006-05-08 06:06:42

Logoleptic
Plugin Author
From: Kansas, USA
Registered: 2004-02-29
Posts: 482

Re: [plugin] [ORPHAN] zem_link

Thanks, Wet.

Offline

#76 2006-05-08 21:07:50

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

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

#81 2006-08-21 15:55:50

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

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

#83 2006-08-21 16:58:31

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

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

Board footer

Powered by FluxBB