0

Is it possible that in a text field to create a link to an entry ? ex :

The movie ,, X MAN ,, is about to reach its top...

Is it possible to have an easy way of adding the link to XMAN text ( a link to an entry from the same website ) ?

I mean, not to manually search and paste the link ...

1

Since content in EE can be displayed anywhere you want, using any URL (template group/template), this is very difficult to do in an automated way. Only Pages module or Structure module entries can be predictably linked to in this manner - and if you use a fieldtype like Wygwam you can do this via its Link pop-up.

But perhaps you want to look at Low Link? This works well if you want to link the exact titles of entries, and they all are in the same channel.

0

I don't know about text fields, dynamically anyway. You could add a playa field for the entries and then toss that variable in a predict text block inside the template.

Is it something you want to be on the fly and have free changing text/copy or is it standard? I think that would determine if it was feasible to use playa or not.

If it's text that needs to be free flowing, then maybe using Allow EE Code.

Per the description:

Allows ExpressionEngine code to be used in entries and then parsed in the template. Currently, you cannot put EE tags into an entry/post and have them rendered in the template. Instead, the code itself will just display, unprocessed. This plugin makes it so any EE tags in an entry will actually be parsed and have results outputted.

This would allow you to use the natural EE linking to entries.

0

I have an idea that might work - using either native relationships or Playa, along with Low Replace. No idea if the parse order will allow you to do this (you may need to use stash to cheat parse order to make the mechanics of this idea actually work). It's an untested idea - so here goes:

1) Establish a "related movies" relationship field. Your entry would then be related to the movies mentioned in the article body.

2) in the body of the text, be sure to use the title of the move as it appears in your movies channel - basically what we're looking to do is a bit of find and replace magic next, but it would need to match for the find and replace to be successful.

3) use low replace tag to search the body for the exact title and replace it with the linked title, following your URL pattern. The challenge is that you have to set the low replace parameters of "find" and "replace" dynamically based on the relationship field. This is the main point of concern - and stash may be the way to get the parse order to work in your favor. I don't know if you can get the parse order to flow properly natively, since you would need the relationship field to parse, then the body, then the low replace.

Anyway, that's the framework that I believe COULD work. A bit complicated though, and I'm sure from a performance perspective, it's far from ideal. But in terms of being able to automatically seek out the titles and link to entries, it may be a way to make it work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.