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
16 Dec 2014 19:36

Sergey 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?

Yep, that's the point. WHY do you need to find the random VALUE... just treat it as a usual text part of the title. In other words, if [RAND] has been replaced once on first save... just keep the result, you don't have to change or replace it again?!


Sergey
Total posts: 13,748
19 Dec 2014 05:30

pepperstreet Yep, that's the point. WHY do you need to find the random VALUE... just treat it as a usual text part of the title. In other words, if [RAND] has been replaced once on first save... just keep the result, you don't have to change or replace it again?!

OK. ATTENTION!

HOw composite title is build.

  1. I take string $title = "Car - [RAND] ([12], [15])"
  2. I replace fields $title = str_replace('[12]', $field_value, $title)
  3. I replace rand $title = str_replace('[RAND]', MD5(time()), $title)
  4. I get the result Car - E45RT (BMW, 2012)

That is clear right? It is more complacated of course but we have to get principle here.

Now lets imagine I edit record.

  1. I take string $title = "Car - [RAND] ([12], [15])"
  2. I replace fields $title = str_replace('[12]', $field_value, $title)
  3. Now I have to replace RAND not view new MD5(time()) but get old one. So I get $title = str_replace('[RAND]', $old_rand, $title)

Now question. I have only Car - E45RT (BMW, 2012) as part wheer rand is saved. How do I extract E45RT from the Car - E45RT (BMW, 2012) string? What rules I apply to analyze it?

Powered by Cobalt