Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2023-03-29 12:51:09

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,277
GitHub

Container tag for search term in an article

I have a new Textpattern-powered project in the works, and I’m trying to simplify / streamline a workflow for when an article contains a string that is hyperlinked to a search. For example, the terms ‘consectetur adipiscing’ and ‘pulvinar lacinia’ in an article are links to a search for that term:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed tincidunt maximus varius. Praesent leo risus, pulvinar lacinia justo in, eleifend venenatis neque.

I’ve checked the Textpattern search tags and not found anything that fits the bill.

Ideally, an article could be written and a container tag would be tacked around the term(s) that are to be hyperlinked, and Ye Trusty TextpatternMagick© does the rest.

My instinct says this is already a solved problem, but I’m not sure how. Any feedback or advice would be very gratefully received. Thank you.

Offline

#2 2023-03-29 13:39:57

etc
Developer
Registered: 2010-11-11
Posts: 5,235
Website GitHub

Re: Container tag for search term in an article

Not sure to understand you right, but if you want to construct search links via a container, why not to create a form (say, search):

<a href="search/URL/for/<txp:yield escape='url' />"><txp:yield /></a>

and call it where you need like

... <txp::search>pulvinar lacinia</txp::search> ...

Offline

#3 2023-03-29 13:47:07

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,277
GitHub

Re: Container tag for search term in an article

Thanks, etc – that looks promising! I really appreciate that.

Offline

Board footer

Powered by FluxBB