0

I'm using Drupal 7 Entity Reference field in one of the content types. I want to populate the Auto complete field with pages created using my custom module.

Currently in the options, it is showing only the content types that are existing. How can I achieve this?

5
  • make a unique content-type for these pages
    – rémy
    Commented Mar 8, 2016 at 9:26
  • Actually, these pages are different. These are listed in hook_menu() in my module.
    – Kiran
    Commented Mar 8, 2016 at 9:30
  • 1
    then you need to convert them to entities, or create a custom field that in your module that allows this reference
    – rémy
    Commented Mar 8, 2016 at 9:36
  • Any tutorial for converting nodes into entities?
    – Kiran
    Commented Mar 11, 2016 at 9:51
  • you have to define entities yourself, and also write the conversion ... for entities, the entity API(drupal.org/project/entity) can be quite helpful.
    – rémy
    Commented Mar 11, 2016 at 22:24

1 Answer 1

0

why don't you serve regular nodes of a new content-type in your hook_menu callback ? so you could easily reference them !

$html = node_view(node_load(948));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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