Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-01-24 17:57:40

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,256
Website GitHub Mastodon Twitter

[SOLVED] variable troubles

I am losing my hair with this one.

I am trying to create a page with all contributors to our projects. Some people have sites others don’t. I would like the names in this this page to appear in alphabetical order and to be able to edit site urls on the go so I thought of the linklists

What I am trying to achieve is to have a linked entry whenever there is a link or just an unlinked name if no site is associated with it.

<txp:variable name="haslink" value='<txp:link_url />' />
<txp:linklist category="contributors" limit="999" sort="linkname" break=" &bull; ">
<txp:if_variable name="haslink" value="">
<txp:link_name escape="html" />
<txp:else />
<a class="ext" href="<txp:link_url />"><txp:link_name escape="html" /></a>
</txp:if_variable>
</txp:linklist>

the code above somehow just returns the whole list of names unlinked.

Any ideas why?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#2 2011-01-24 18:07:15

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: [SOLVED] variable troubles

Hi Yiannis,

I think the variable tag should be inside the linklist tags, otherwise there will never be a link_url because it’s not in link context.

Offline

#3 2011-01-24 18:33:16

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,256
Website GitHub Mastodon Twitter

Re: [SOLVED] variable troubles

as always:)

Thanks els. that was it


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB