Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Links in 4.7
Up to now, the links tab was accepting values without a link in the URL field. A method which assisted us in generating lists but also to use the tab in more creative ways.
Now the info is not saving unless a link is entered. Is there a way to bring back the old functionality, where the URL field was not compulsory?
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: Links in 4.7
Dunno, potentially it leads to <a />
tags without href
attribute, which are kinda invalid. You can just put #
as URL, perhaps?
Offline
Re: Links in 4.7
Hi Oleg,
Maybe I should supply some sample code I am using here
<txp:linklist category="contributors" limit="999999" sort="linksort" break=" • " wraptag="p">
<txp:variable name="haslink" value='<txp:link_url />' />
<txp:if_variable name="haslink" value="">
<txp:link_name escape="" />
<txp:else />
<a class="ext" href="<txp:link_url />" rel="external"><txp:link_name escape="html" /></a>
</txp:if_variable>
</txp:linklist>
and here
<txp:act_if_mobile>
<p>A random selection from the 16 videos from the conference. Refresh your browser to view others</p>
<txp:linklist category="ttrrandvid" limit="6" sort="rand()" form="videos" wraptag="div" class="slider" />
</txp:act_if_mobile>
and the form
<iframe src="https://player.vimeo.com/video/<txp:link_description escape="" />?title=0&byline=0&portrait=0" allowfullscreen></iframe>
Currently I am actually using # which I then delete in phpMyAdmin.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: Links in 4.7
I guess I could change my code to make it work as intended.
<txp:linklist category="contributors" limit="999999" sort="linksort" break=" • " wraptag="p">
<txp:variable name="haslink" value='<txp:link_url />' />
<txp:if_variable name="haslink" value="#">
<txp:link_name escape="" />
<txp:else />
<a class="ext" href="<txp:link_url />" rel="external"><txp:link_name escape="html" /></a>
</txp:if_variable>
</txp:linklist>
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Offline
Re: Links in 4.7
Sure, optional’s good. If it makes it more flexible for esoteric uses, the worst that can happen is generating a blank anchor, which is up to the designer anyway.
EDIT: Having said that, I can’t see any overarching use cases to make it optional. Yiannis’ code with the ‘#’ works equally well. It’s whether we see the link content type as fundamental enough to warrant enforcing the destination. I mean, that’s what the Link type is for… right? If you’re not using links to generate links, what do people use them for?
Last edited by Bloke (2018-05-22 11:09:08)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Links in 4.7
Bloke wrote #311966:
that’s what the Link type is for… right? If you’re not using links to generate links, what do people use them for?
I agree with this. Making it optional is a bit counter to what the expected functionality would be, I think. Esoteric uses are probably very rare, and as long as they can be done by another way, then why leave it ‘weird’. ;)
Then again, I have no real position either way.
Offline
Re: Links in 4.7
Bloke wrote #311966:
I can’t see any overarching use cases to make it optional. Yiannis’ code with the ‘#’ works equally well.
That’s what I thought too, but it’s an old (if not the oldest!) txp site, so Yiannis would need to treat two cases. And the use of #
is rather esoteric anyway.
If you’re not using links to generate links, what do people use them for?
Actually, href
-less links are HTML5-valid (href
could be set via, say, JS). Why would we force people into “traditional” way?
Offline
Re: Links in 4.7
etc wrote #311973:
Actually,
href
-less links are HTML5-valid (href
could be set via, say, JS).
In that case, making them optional is fine by me.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Links in 4.7
Bloke wrote #311966:
If you’re not using links to generate links, what do people use them for?
I use the tab in a number of ways not all of which are to generate links. Two methods, I explain above. The #
method nevertheless works for me so no worries if you decide to keep it as it is.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Offline
Pages: 1