*

kriskoyk

  • *****
  • 307 posts
"*" character in attributes
« on: April 03, 2024, 10:09:59 PM »
Can the "*" character be inserted into all required attributes automatically with the "Required" option? If so, how can this be done?
« Last Edit: April 03, 2024, 10:11:45 PM by kriskoyk »

*

MB Themes

Re: "*" character in attributes
« Reply #1 on: April 05, 2024, 03:17:08 PM »
Not getting exactly what you want to achieve.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

kriskoyk

  • *****
  • 307 posts
Re: "*" character in attributes
« Reply #2 on: April 05, 2024, 03:37:07 PM »
Ok Thanks

*

kriskoyk

  • *****
  • 307 posts
Re: "*" character in attributes
« Reply #3 on: April 06, 2024, 10:30:36 PM »
I want the user to easily distinguish the required attribute, so I added "*" next to the attribute name, but this also appears in the search. How can I make it appear only in the entry-edit post?

*

MB Themes

Re: "*" character in attributes
« Reply #4 on: April 08, 2024, 10:02:04 AM »
You must add star manually to plugin files, you cannot add that via translation
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

kriskoyk

  • *****
  • 307 posts
Re: "*" character in attributes
« Reply #5 on: April 08, 2024, 10:36:43 AM »
I had added the star manually through configuration in both languages. In which file should I do what you suggest? Can you please give an example?
« Last Edit: April 08, 2024, 10:52:09 AM by kriskoyk »

*

MB Themes

Re: "*" character in attributes
« Reply #6 on: April 08, 2024, 01:15:29 PM »
You must go to PHP files, but there usually you do not find field itself, but it's printed via loop so it's not that simple.
Will look on it in next update.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

kriskoyk

  • *****
  • 307 posts
Re: "*" character in attributes
« Reply #7 on: April 08, 2024, 01:33:03 PM »
Yes, you should see it soon because it will help the user a lot to see fields that are mandatory. Thanks for the replies.

*

kriskoyk

  • *****
  • 307 posts
Re: "*" character in attributes
« Reply #8 on: April 08, 2024, 10:28:09 PM »
In the end it was very easy. An IT student friend put this:

Code: [Select]
($a['b_required'] == 1 ? '<span class="req">*</span>' : '') .
here (functions.php file):
 
Code: [Select]
if($linked === false) {
    $html .= '<div class="control-group atr-type-' . strtolower($a['s_type']) . ' ' . ($a['s_type'] == 'CHECKBOX' ? 'atr-check-options-' . ($a['b_check_single'] == 1 ? 'single' : 'multi') : '') . '" id="atr-' . ($a['s_identifier'] <> '' ? $a['s_identifier'] : 'id' . $a['pk_i_id']) . '">';
    $html .= '<label class="control-label" for="atr' . $a['pk_i_id'] . '">' . ($name <> '' ? $name : __('New attribute', 'attributes')) . ($a['b_required'] == 1 ? '<span class="req">*</span>' : '') . '</label>';
    $html .= '<div class="controls">';
  } else {
    $html .= '<div class="atr-linked">';
  }

    and the problem is solved. Thanks again for the replies

*

MB Themes

Re: "*" character in attributes
« Reply #9 on: April 09, 2024, 03:16:49 PM »
Correct.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

kriskoyk

  • *****
  • 307 posts
Re: "*" character in attributes
« Reply #10 on: April 09, 2024, 04:19:02 PM »
Ok Thanks