clowride VIP
Total posts: 1,022
04 Фев 2013 07:10

would be nice to have a field which add promotion or featured or anything else to records

example : featured, just updated, verified, profesional page, etc..

same with users, badge would be for users who have submited many records

regards

Последние изменения: 09 Март 2015


Sergey
Total posts: 13,748
04 Фев 2013 08:03

I think it should be done on the level of template.


pepperstreet VIP
Total posts: 3,837
18 Нояб 2013 23:17

Apart from Cobalt custom fields and template…

  • Cobalt internal Events & Karma points? (As far as i know not unused, not displayed, yet. Why?)
  • AUP integration (medals)
  • Easy Social integration (badges)

brianpat VIP
Total posts: 211
04 Март 2015 18:44

This would be a good feature. I like it. can anyone suggest how to do it?


pepperstreet VIP
Total posts: 3,837
05 Март 2015 06:54

I think Status field is a nice option. Would allow quick changes in list and full view without entering the edit/save mode. There is also access rights etc.


brianpat VIP
Total posts: 211
05 Март 2015 10:48

pepperstreet I think Status field is a nice option. Would allow quick changes in list and full view without entering the edit/save mode. There is also access rights etc.

But what I can see status is more related to comments system. I dont see any options for applying it to featured option. any idea?


pepperstreet VIP
Total posts: 3,837
05 Март 2015 18:44

brianpat I dont see any options for applying it to featured option. any idea?

Nope, The regular "featured" function is not related. Maybe a valid feature request ;)

Actually, my comment was a reply to the initial question for a "field". My idea is for adding different "badges" to a record, in a faster, convenient way. Additionally, you have a lot of options for workflows and notifications. Hence the custom SQLs: You might trigger and modify the "featured" properties with it.


pepperstreet VIP
Total posts: 3,837
07 Март 2015 18:44

brianpat I dont see any options for applying it to featured option. any idea?

Additional weird idea and workaround:

If you use a custom list/full-view template, you might put the Status field inside the "featured" markup. Result: A conditional Status badge related to the core "featured" option ;)


brianpat VIP
Total posts: 211
07 Март 2015 21:14

Additional weird idea and workaround:

If you use a custom list/full-view template, you might put the Status field inside the "featured" markup. Result: A conditional Status badge related to the core "featured" option ;)

That sounds good to me, but how will I do it in terms of changing the code.


pepperstreet VIP
Total posts: 3,837
09 Март 2015 03:03

brianpat how will I do it in terms of changing the code.

Take a look into the various Cobalt templates. Search for if($item->featured)

Most likely you will find something like this:

<?php if($item->featured) echo ' success' ?>

or the following if/else for other record statuses:

<?php if($item->featured)
        {
            echo ' success';
        }
        elseif($item->expired)
        {
            echo ' error';
        }
        elseif($item->future)
        {
            echo ' warning';
        }?>

These lines do simply output (echo) different words. Those words represent the CSS class. Which is reponsible for the different color in frontend. i.e. success = light green background on table row


You might replace the entire echo with your field code. That's all.

  • Either you hard-code the field with a certain ID,
  • or you can make even make it flexible with a template parameter! i.e. see Docs article under "Setting Field In Parameters".
    Tip: Have a look into a Cobalt template like Gallery-pack or Events. Hence the UNSET command if you use the default field loop! Otherwise you end up with duplicated field output ;)
Работает на Cobalt