Discussion:
[development] New content type
Nicolas
2015-02-05 07:11:47 UTC
Permalink
Hi all,

I used to make website with drupal 6 and I defined new content type using
new node type.
I tried to do the same thing with drupal 7... But after some readings I
discover it could not be the right way.

Must I used entity ? I want to access my new type as it was node with
?q=node/add/my-new-type

I search for goods tutorials but didn't find somes.

Thanks in advance for any help or any advice.

Nicolas
Muzaffer Tolga Ozses
2015-02-05 07:18:36 UTC
Permalink
Hi Nicolas,

You may read the following:
http://www.thecarneyeffect.co.uk/creating-custom-content-type-adding-fields-programmatically-drupal-7
Post by Nicolas
Hi all,
I used to make website with drupal 6 and I defined new content type using
new node type.
I tried to do the same thing with drupal 7... But after some readings I
discover it could not be the right way.
Must I used entity ? I want to access my new type as it was node with
?q=node/add/my-new-type
I search for goods tutorials but didn't find somes.
Thanks in advance for any help or any advice.
Nicolas
--
mto
Nicolas
2015-02-05 09:34:26 UTC
Permalink
Hi,

thanks for your answer. I will read that article carrefully.

But I should have been more precise in my question. I want to create new
content in the right way (if there is at least one) in drupal 7. I think I
must use entity if I understand right. But I don't want to use field api. I
don't want to have as many tables as fields in my new content. I cannot
understand how someone can have to that strange stuff.

Manage data in a database is a hard work and for sure field api is a great
work but it's also a bloatware and a nightmare with a large site. I have to
maintain a large site and there's severals hundred of tables but with
contents no so different. So even simple pages have severals hundred of
queries. My site is not so complicated. Did developers who made the site
missed something ?

Don't misunderstand me, I like drupal. I hope drupal 8 comming soon. But I
really think some api must not be used.

Nicolas
Post by Muzaffer Tolga Ozses
Hi Nicolas,
http://www.thecarneyeffect.co.uk/creating-custom-content-type-adding-fields-programmatically-drupal-7
Post by Nicolas
Hi all,
I used to make website with drupal 6 and I defined new content type using
new node type.
I tried to do the same thing with drupal 7... But after some readings I
discover it could not be the right way.
Must I used entity ? I want to access my new type as it was node with
?q=node/add/my-new-type
I search for goods tutorials but didn't find somes.
Thanks in advance for any help or any advice.
Nicolas
--
mto
Muzaffer Tolga Ozses
2015-02-05 09:37:19 UTC
Permalink
If you don't want fields in your content type, feel free to leave related
parts out :) About entity, I don't know what you mean with that. Nodes are
also entities.
Post by Nicolas
Hi,
thanks for your answer. I will read that article carrefully.
But I should have been more precise in my question. I want to create new
content in the right way (if there is at least one) in drupal 7. I think I
must use entity if I understand right. But I don't want to use field api. I
don't want to have as many tables as fields in my new content. I cannot
understand how someone can have to that strange stuff.
Manage data in a database is a hard work and for sure field api is a great
work but it's also a bloatware and a nightmare with a large site. I have to
maintain a large site and there's severals hundred of tables but with
contents no so different. So even simple pages have severals hundred of
queries. My site is not so complicated. Did developers who made the site
missed something ?
Don't misunderstand me, I like drupal. I hope drupal 8 comming soon. But I
really think some api must not be used.
Nicolas
Post by Muzaffer Tolga Ozses
Hi Nicolas,
http://www.thecarneyeffect.co.uk/creating-custom-content-type-adding-fields-programmatically-drupal-7
Post by Nicolas
Hi all,
I used to make website with drupal 6 and I defined new content type
using new node type.
I tried to do the same thing with drupal 7... But after some readings I
discover it could not be the right way.
Must I used entity ? I want to access my new type as it was node with
?q=node/add/my-new-type
I search for goods tutorials but didn't find somes.
Thanks in advance for any help or any advice.
Nicolas
--
mto
--
mto
Nicolas
2015-02-05 09:39:32 UTC
Permalink
Post by Muzaffer Tolga Ozses
If you don't want fields in your content type, feel free to leave related
parts out :) About entity, I don't know what you mean with that. Nodes are
also entities.
I know node are entities. I search for an article explaining how to create
a new content type (available from node/add/my-content-type), using
entities, without field api.
Muzaffer Tolga Ozses
2015-02-05 09:41:10 UTC
Permalink
If you want to create a content type programmatically, you have to use
pretty much like the article I pointed to.
Post by Nicolas
Post by Muzaffer Tolga Ozses
If you don't want fields in your content type, feel free to leave related
parts out :) About entity, I don't know what you mean with that. Nodes are
also entities.
I know node are entities. I search for an article explaining how to create
a new content type (available from node/add/my-content-type), using
entities, without field api.
--
mto
David Metzler
2015-02-06 02:50:45 UTC
Permalink
As a database developer (oracle, Postgres, MySQL, mssql), I can say that there are some distinct advantages to the entity value approach used by drupal. I would not discard it out of hand just because you believe it will take too many tables. For example, it makes queries across content types (e.g. calandars of multiple content types that have different numbers of fields in them) much more performative.

Shameless plug: If you're a database developer and handy with SQL and are planning on building your own custom tables/entities then you might consider using http://drupal.org/project/forena

Dave

Sent from my iPad
If you don't want fields in your content type, feel free to leave related parts out :) About entity, I don't know what you mean with that. Nodes are also entities.
I know node are entities. I search for an article explaining how to create a new content type (available from node/add/my-content-type), using entities, without field api.
Nicolas
2015-02-06 06:58:49 UTC
Permalink
Thanks for your answer David. I understand that it's not as bad as I said.
But when there's several hundred of queries per pages it can be runned on a
dev environnement.
Post by David Metzler
As a database developer (oracle, Postgres, MySQL, mssql), I can say that
there are some distinct advantages to the entity value approach used by
drupal. I would not discard it out of hand just because you believe it
will take too many tables. For example, it makes queries across content
types (e.g. calandars of multiple content types that have different numbers
of fields in them) much more performative.
Shameless plug: If you're a database developer and handy with SQL and are
planning on building your own custom tables/entities then you might
consider using http://drupal.org/project/forena
Dave
Sent from my iPad
Post by Muzaffer Tolga Ozses
If you don't want fields in your content type, feel free to leave related
parts out :) About entity, I don't know what you mean with that. Nodes are
also entities.
I know node are entities. I search for an article explaining how to create
a new content type (available from node/add/my-content-type), using
entities, without field api.
Muzaffer Tolga Ozses
2015-02-06 07:18:56 UTC
Permalink
APIs are nice. Use them. They ease your life.
Post by Nicolas
Thanks for your answer David. I understand that it's not as bad as I said.
But when there's several hundred of queries per pages it can be runned on a
dev environnement.
Post by David Metzler
As a database developer (oracle, Postgres, MySQL, mssql), I can say that
there are some distinct advantages to the entity value approach used by
drupal. I would not discard it out of hand just because you believe it
will take too many tables. For example, it makes queries across content
types (e.g. calandars of multiple content types that have different numbers
of fields in them) much more performative.
Shameless plug: If you're a database developer and handy with SQL and are
planning on building your own custom tables/entities then you might
consider using http://drupal.org/project/forena
Dave
Sent from my iPad
Post by Muzaffer Tolga Ozses
If you don't want fields in your content type, feel free to leave
related parts out :) About entity, I don't know what you mean with that.
Nodes are also entities.
I know node are entities. I search for an article explaining how to
create a new content type (available from node/add/my-content-type), using
entities, without field api.
--
mto
Erik Stielstra
2015-02-05 10:25:14 UTC
Permalink
But I really think some api must not be used.
You are of course free to use or not to use the API. However if you do use the API and follow the common practices in Drupal (to use entities + field API) you get all the integration that comes with it for free. If you decide to go you own route, you have to take care of all the integrations yourselves.
I have to maintain a large site and there's severals hundred of tables but with contents no so different. So even simple pages have severals hundred of queries. My site is not so complicated. Did developers who made the site missed something ?
150 tables for a small site, 300 tables for a medium sized site is no exception. Fields will be responsible for 25 - 40% of the number of tables. But how many tables will you be able to save, and how much coding effort do you want to put into it? Working around Drupal is not easier than working with Drupal. Both have their learning curve.


Erik Stielstra
Hi,
thanks for your answer. I will read that article carrefully.
But I should have been more precise in my question. I want to create new content in the right way (if there is at least one) in drupal 7. I think I must use entity if I understand right. But I don't want to use field api. I don't want to have as many tables as fields in my new content. I cannot understand how someone can have to that strange stuff.
Manage data in a database is a hard work and for sure field api is a great work but it's also a bloatware and a nightmare with a large site. I have to maintain a large site and there's severals hundred of tables but with contents no so different. So even simple pages have severals hundred of queries. My site is not so complicated. Did developers who made the site missed something ?
Don't misunderstand me, I like drupal. I hope drupal 8 comming soon. But I really think some api must not be used.
Nicolas
Hi Nicolas,
You may read the following: http://www.thecarneyeffect.co.uk/creating-custom-content-type-adding-fields-programmatically-drupal-7
Hi all,
I used to make website with drupal 6 and I defined new content type using new node type.
I tried to do the same thing with drupal 7... But after some readings I discover it could not be the right way.
Must I used entity ? I want to access my new type as it was node with ?q=node/add/my-new-type
I search for goods tutorials but didn't find somes.
Thanks in advance for any help or any advice.
Nicolas
--
mto
Muzaffer Tolga Ozses
2015-02-05 11:08:32 UTC
Permalink
Sutharsan++
Post by Erik Stielstra
But I really think some api must not be used.
You are of course free to use or not to use the API. However if you do use
the API and follow the common practices in Drupal (to use entities + field
API) you get all the integration that comes with it for free. If you decide
to go you own route, you have to take care of all the integrations
yourselves.
I have to maintain a large site and there's severals hundred of tables
but with contents no so different. So even simple pages have severals
hundred of queries. My site is not so complicated. Did developers who made
the site missed something ?
150 tables for a small site, 300 tables for a medium sized site is no
exception. Fields will be responsible for 25 - 40% of the number of tables.
But how many tables will you be able to save, and how much coding effort do
you want to put into it? Working around Drupal is not easier than working
with Drupal. Both have their learning curve.
Erik Stielstra
Hi,
thanks for your answer. I will read that article carrefully.
But I should have been more precise in my question. I want to create new
content in the right way (if there is at least one) in drupal 7. I think I
must use entity if I understand right. But I don't want to use field api. I
don't want to have as many tables as fields in my new content. I cannot
understand how someone can have to that strange stuff.
Manage data in a database is a hard work and for sure field api is a
great work but it's also a bloatware and a nightmare with a large site. I
have to maintain a large site and there's severals hundred of tables but
with contents no so different. So even simple pages have severals hundred
of queries. My site is not so complicated. Did developers who made the site
missed something ?
Don't misunderstand me, I like drupal. I hope drupal 8 comming soon. But
I really think some api must not be used.
Nicolas
Hi Nicolas,
http://www.thecarneyeffect.co.uk/creating-custom-content-type-adding-fields-programmatically-drupal-7
Hi all,
I used to make website with drupal 6 and I defined new content type
using new node type.
I tried to do the same thing with drupal 7... But after some readings I
discover it could not be the right way.
Must I used entity ? I want to access my new type as it was node with
?q=node/add/my-new-type
I search for goods tutorials but didn't find somes.
Thanks in advance for any help or any advice.
Nicolas
--
mto
--
mto
Continue reading on narkive:
Loading...