darkhoros VIP
Total posts: 152
27 Nov 2014 19:34

Hi all, I just subscrooibed and got covalt everything installed to test cobalt for my new project. I have remarks: The breadcrumb is stragne: it shows the following: You are here: Home (at home page) You are here: Home Real Estate (at section page) You are here: Home Real Estate villas (at categories page) uptill now it is logic and at article page it shows

You are here: Home Real Estate username article title (at article page)

2 questions here, the breadcrumb should go as is to the article page so it should render like this

You are here: Home Real Estate villas article title Or for generic use : Home section category article

And the same for the URL structure why do I show the username in the URL while I should show the section/category name, I may show the username in URL if the user has used a like on the website to show the article by a specific user. BTW i have read almost all the FAQ about URL ans sef URLs and I understand the performance concerns cobalt devs have.

Now for a simple question, I like to create an auto incremental field, so I have a text field that is not editable but rather shows a value that is auto-incremented with every article added, so I can show a uniue ID before the article title. Is somthing like that possible?

Thank you for great product and even greater support. Regards.

Last Modified: 19 Dec 2014


pepperstreet VIP
Total posts: 3,837
28 Nov 2014 02:35

darkhoros And the same for the URL structure why do I show the username in the URL while I should show the section/category name, I may show the username in URL if the user has used a like on the website to show the article by a specific user.

It depends on settings in -> Section -> Personalization tab

Personalization ON creates an automatic link on the username. Which links to the user's (section) homepage.

There is also related parameter for BreadCrumbs. You can include/exclude the user.

Bildschirmfoto 2014-11-28 um 03.02.01

HeadsUp:
Even with "Personalization OFF", the homepages are reachable. For instance, you can still create a "my homepage" MenuItem for the current user.


You might have noticed the small Filter icon and link near the username. This is a different way to filter the curent section list by a username. In other words, a quick search for 1 user. The same filtering can be used in advanced search, but with multiple users/authors!


darkhoros field that is not editable but rather shows a value that is auto-incremented with every article added, so I can show a uniue ID before the article title

You might use the recordID. It is already there and unique. You have to output the ID in the respective template. (requires some editing)


Sergey
Total posts: 13,748
28 Nov 2014 08:33

darkhoros Now for a simple question, I like to create an auto incremental field, so I have a text field that is not editable but rather shows a value that is auto-incremented with every article added, so I can show a uniue ID before the article title. Is somthing like that possible?

Another way is to use composite title in type parameters and use there [RAND] placeholder to generate unique IDs.

But I afraid there is no incremental. Yes ID is incremental but through all articles. We cannot increment through one section.


darkhoros VIP
Total posts: 152
30 Nov 2014 09:55

pepperstreet

You might use the recordID. It is already there and unique. You have to output the ID in the respective template. (requires some editing)

Ok, where should I do these edits, and will this recordID be available for search and filer, say I have a record ID of 30 if I type 30 in filter field will it be listed in the search results?

Thank you.


pepperstreet VIP
Total posts: 3,837
30 Nov 2014 14:24

darkhoros will this recordID be available for search and filer, say I have a record ID of 30 if I type 30 in filter field will it be listed in the search results?

Sorry, no.
It is neither a part of the parameters, nor the filters system. Just the usual and necessary ID of the DB entry. Comparable to J! core ArticleID.


darkhoros VIP
Total posts: 152
04 Dec 2014 20:58

Ok Pepper, I went on using the RND option but I noticed 1 very importent things,,

The random number changes every time I edit the record and save, at this point the whole idea of having numbered records has been rendered uneffictive, as I like my visitors to be able to take writen note of item number as if they revisit the site can search for this specific item by its number, so if they take note of the record by the random number and i edit the record, and then they revisit the site and search for that random number it will not be there :D

Any advice?

Thank you.


darkhoros VIP
Total posts: 152
04 Dec 2014 21:16

One more thing, you have added an option to add symbloe after the RND in the composite titles, so I have select the minus symbol to separate the RND from the actual text title, but it iss not showing, am I using the option in a wrong way? Thank you.


pepperstreet VIP
Total posts: 3,837
04 Dec 2014 23:42

darkhoros The random number changes every time I edit the record and save

Confirmed. It changes on every edit?!

I would call this a "bug". The number should be generated for NEW records, and not on each edit.

@Sergey ?

darkhoros minus symbol to separate the RND from the actual text title

As far as I know, that should work and is described in the help tooltip and also used in the free "Downloads Pack", which uses a composite title for the extension name. It even includes HTML markup like so:

[15] - [8] <span class="badge">[10]</span>

frontend result:

Bildschirmfoto 2014-12-05 um 00.36.24

How does your syntax/title look like?


Sergey
Total posts: 13,748
05 Dec 2014 05:22

pepperstreet I would call this a "bug". The number should be generated for NEW records, and not on each edit.

@Sergey ?

Yes that, sound like a bug. But unfortunately I have no way to extract random number from generated title. It is nearly impossible.


pepperstreet VIP
Total posts: 3,837
06 Dec 2014 15:43

Sergey

pepperstreet I would call this a "bug". The number should be generated for NEW records, and not on each edit.

@Sergey ?

Yes that, sound like a bug. But unfortunately I have no way to extract random number from generated title. It is nearly impossible.

I know, there is no visible task in Cobalt URL, that differentiates between new and edit... but I remember from an older question and your comments, that it is done with some PHP code... (isNew ...)

So, the script should only run on first save/new records. Each edit must not run the script again. I guess, this is possible somehow.


Sergey
Total posts: 13,748
08 Dec 2014 07:10

pepperstreet I know, there is no visible task in Cobalt URL, that differentiates between new and edit...

It is not matter of new or edit. I can defferenciate it in the code. It is matter of analysis. How do I know, how to parse title to extract exactly the part I need?


pepperstreet VIP
Total posts: 3,837
09 Dec 2014 03:34

Sergey It is not matter of new or edit. I can defferenciate it in the code. It is matter of analysis. How do I know, how to parse title to extract exactly the part I need?

Sorry, don't understand. Extract when and for what?

From my point of view, it is a question to prevent the script/function to run in edit mode. Do I miss something?


Sergey
Total posts: 13,748
10 Dec 2014 03:03

We cannot prevent it on edit. Because some placeholders with fields may be there and those are changed. So we have to edit it edit.


pepperstreet VIP
Total posts: 3,837
10 Dec 2014 14:28

Sergey We cannot prevent it on edit. Because some placeholders with fields may be there and those are changed. So we have to edit it edit.

You mean, you can only disable the whole composite title function/script ? And not the RANDOM separately? Strange. :(

I thought your script simply searches for the [RND] placeholder. And what if it is not used at all. That does also prevent it from running, isn't it?


Sergey I remember, there was an older topic with a similar request. I think you wanted to extend the default templates parameters under "Record Elements". Currently there is no RecordID. Also no Initial-CreateDate ;)

BTW, the Composite Title would also benefit from a current RecordID placeholder.
The help tooltip does not mention the current RecID. Could we have [ID], [RECID] ?
Maybe the core dates make also sense?


Sergey
Total posts: 13,748
11 Dec 2014 02:54

pepperstreet I thought your script simply searches for the [RND] placeholder.

Yes, when it replace [RND] with text. But how can it take that text from already generated composite title? It is hard to understand where is RND and where is field value.


darkhoros VIP
Total posts: 152
11 Dec 2014 21:24

Sergey

Yes, when it replace [RND] with text. But how can it take that text from already generated composite title? It is hard to understand where is RND and where is field value.

serge it takes that text already, as it changes it to another random number so it can already diffrenciate between the [RND] and the text, or how can this number change on save every time, if what you say is true, then each time I save another random number will be attached to the text so the titel after 3 save will look some thing like this

1213 - 1233 - 6543 - some title here save 3 time so I have 3 [RND]s

so if it can know where the [RND] is then it should keep it as is. Am I right? Thank you alot for your prompt replies and support. Regards.


Sergey
Total posts: 13,748
12 Dec 2014 01:42

When it is changes on save, it always uses composite title pattern which you saved in type parameters. In this patern it is easy to find out where to insert pandom to. We just replace [RAND]. But when string is composed, it is hard to detect which part of the title string is a rand.


darkhoros VIP
Total posts: 152
12 Dec 2014 12:05

Hi, well it may on save check if a match to the pattern used is exists, if so it will ignore the generation on new RAND is the pattern is not there then just create the new RAND, this is my input with the very little knowledge I have.

You know better.

Thank you.


Sergey
Total posts: 13,748
15 Dec 2014 09:24

darkhoros well it may on save check if a match to the pattern used is exists

This is the problem. Hard to match. How do I know that part of the string I found is the rand and not the value of the field or custom text?


pepperstreet VIP
Total posts: 3,837
15 Dec 2014 22:19

Sergey I found is the rand and not the value of the field or custom text?

I might be wrong here, but why is the value/result important? IMHO, the most crucial part is the records mode i.e. new or edit.

BTW, you said it is hard to find the RND-value in a composited title... but how do you replace it with the new random number then?!? If you can replace it on every save... you should be able to block this on edit.


Sergey
Total posts: 13,748
16 Dec 2014 07:31

pepperstreet BTW, you said it is hard to find the RND-value in a composited title... but how do you replace it with the new random number then?!?

Whenever I replace it, I replace it in composite title parameter. So for me it is not important if it is edit or add. The procedure is the same.

pepperstreet If you can replace it on every save... you should be able to block this on edit.

Now the tricky part.

Lets say I have composite patern like this Car - [RAND] ([12], [15]) and it resulted in Car - E45RT (BMW, 2012). Now I save article. I want to replace [12] and [13] with field values, because those might changed but I need to keep [RAND]. How to I extract E45RT from Car - E45RT (BMW, 2012)? How do I know that thispart of the text is a rand?

Powered by Cobalt