Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
[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=" • ">
<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
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
Pages: 1