As a user browses to www.example.com/node/add they get a list of available content types a user can add. How do we get a custom entity type to show up in this list? We are working on a project that has 2 or 3 custom entities, and would like them to show up in this list?

Thanks
John

Comments

nevets’s picture

Why not just use content types then?

ponyxprs’s picture

These content types have their own database tables. We are hoping to improve performance by not using the node table and all the other tables that come with it. There is very little need for additional fields, users have very few options for the content, didn't want to use the comments module for these entities, don't plan on saving different versions of each entity.

Also would like these entities to show up in the 'Tracker' view as well.

WorldFallz’s picture

Since these aren't nodes, I'd probably just create a new page and/or menu that lists whatever I needed there (nodes, custom entities, whatever).

However, if you really want to force it to appear at node/add I would think you'd have to use hook_menu_alter to intercept and alter the rendering of that page. See node.module and node.pages.inc.

For the tracker, I'd definitely just replace it with a custom view.

jaypan’s picture

Creating new pages as overrides is definitely the way to go. Trying to hack the existing pages just turns into a headache (speaking from experience).

Contact me to contract me for D7 -> D10/11 migrations.