简体   繁体   中英

Drupal Inserting Node content into a View

Is it possible to link to the value of another node's field in a piece of content?

For instance, I have a new content type of 'Static Link' which has two fields (Title, Link). I'd like to be able to write a blog post and insert the link value from a Static Link record.

I've read about tokens, but I'm under the assumption that they only pertain to views and not other content.

EDIT:

I'm looking for a way to insert content into in-line text, not linking records together and having the view render them. I probably should have been clearer.

So you need to have a relationship between your blog post and your Static Link node : you can try Entity Reference or Node Reference , which give you a new field type to hold a reference to another node or entity. Therefore you can add a new field in your Blog Post content type and grab the Static Link fields in a view listing Blog Posts, and manage the display of these fields on the "manage display" page for Blog Posts.

If it is relevant for your use case you could also use taxonomy terms to link Blog Posts and Static Links (so you have to add taxonomy term reference fields in both content type), so you could grab Static Links related to Blog Posts with views, using relationships.

You can also use Link which add a new field type for links, and add a new field of this type in Blog Post content type, which is certainly the simpliest solution.

you can always do < a href ="/node/122" > Some nice title < /a > with full html filter. It is not the best for SEO, but it will do the job.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM