9 years ago
9
Topic

Hello, is it possible to put field with unique number for every new submission in category ?

Something like this:

Category One:

  • First Submition (1)
  • Second Submission (2)
  • Third Submission (3)

Category Two:

  • First Submition (1)
  • Second Submission (2)
  • Third Submission (3)

Thanks in advice!

Get a Book for SEBLOD
120 Posts
root
9 years ago
6
Level 1

Hi,

I think you don't need seblod for this, just create a column by hand, in mysql type INT(10) UNSIGNED and AUTO_INCREMENT flag.

Kind regards.

9 years ago
5
Level 2

Hi, this is good idea, but i wanna AUTO_INCREMENT for every category :(

9 years ago
4
Level 3

I would create a new Category Content Type "category with counter"
and add a field "last id".

Once an article in that Category is created,
the field value is incremented + 1 and used for the id of the new article.

After article creation success, the field "last id" is updated.

9 years ago
3
Level 4

I didn't find "category with counter" Content Type. Can you tell me where is it ?

Best Regards!

9 years ago
2
Level 5

Hi Derekman,

that would be a custom Content Type you create on your own.
You can duplicate and extend the provided category Content Type.

Have a look at this tutorial:

https://www.youtube.com/watch?v=l1kc9CziCmc

It's about editing an "Article" Content Type - the procedure for a "Category" Content Type
is basically the same.

9 years ago
0
Level 6

Thank you, i will check the tutorial immediately!

9 years ago
0
Level 6

Hello Viktor, 

i already created category content type, can you give me more info about 'last id' field in category and article content types ? Is this field same for category/article and where to add option to increment after article submit ?

9 years ago
1
Level 1

Hi Dreakman,
what do you want to happen if

a) an article inbetween gets deleted?

b) a just created article gets deleted and a new one created?

should everything be recounted or is it ok to have gaps,
so the last submission doesn't necessarily represent the total number of articles?

9 years ago
0
Level 2

Hi Viktor,

If the article is deleted I want to continue the arrangement following number:

- Article 1 - ID1

- Article 2 - ID2

- Article 3 (DELETED) - ID3

- Article 4 - ID4

etc.

It should have gaps for the deleted articles.

Best Regards!

Get a Book for SEBLOD