I'm looking for a part-time remote job.

Hire me


I'm the author of:

Mastering Redmine is a comprehensive guide with tips, tricks and best practices, and an easy-to-learn structure.

Check the book's project or

Buy the book

Social pages of the book:

By buying this book you also donate to Redmine (see this page).


Follow me:

Support #1949

Link with custom text

Added by Ismail SEZEN over 12 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
23 Jan 2012
Due date:
% Done:

0%

Redmine version:
External issue:

Description

Hi, Andrey,

First of all, you are doing an amazing job. Thank you very much. And my question:

How can I get a result like that by using custom field:

<a class="external" href="http://www.gnu.org/licenses/gpl-2.0.html">GNU General Public License (GPL) v2.0</a>

as same as in the page overview of this plugin. (License custom field)

I could not figure it out.

History

#1 Updated by Andriy Lesyuk over 12 years ago

  • Status changed from New to Open
  • Assignee set to Andriy Lesyuk

Hi, Ismail!

Very happy to communicate with you again! Thanks for your feedback! I greatly appreciate it!

It’s called ”custom field template”... License field is customized by name. See this Wiki page for more details.

Regarding the License field here is its template app/views/custom_values/list/_license.rhtml:

<% case custom_field.value
   when 'GNU General Public License (GPL) v2.0' %>
  <%= link_to(h(custom_field.value), 'http://www.gnu.org/licenses/gpl-2.0.html', :class => 'external') %>
<% else %>
  <%= custom_field.value %>
<% end %>

#3 Updated by Ismail SEZEN over 12 years ago

Thank you, Andriy Same for me. It’s very nice to talk with you again.

I’ve already checked the links that you mentioned. I’ve created “_license.rhtml” file and entered the code above but I can not figure it out yet. I uploaded the file, restart the redmine, migrated the db but I don’t see a type named “license” in the Format combobox.

In the meantime, I’ve created a custom field named License and which type is text and entered the text below:

GNU General Public License (GPL) v2.0

(I can get the code you supplied a little bit) but It did not gave me anything. What am I missing?

#4 Updated by Andriy Lesyuk over 12 years ago

  • Status changed from Open to In Progress

Note the path app/views/custom_values/list/_license.rhtml.

Here:
  • list is custom field type
  • license is custom field name

So if you created License field of type text the path should be: app/views/custom_values/text/_license.rhtml

Also note that text type is displayed as “Long text” and “Text” is actually string type. So the path may be: app/views/custom_values/string/_license.rhtml.

#5 Updated by Ismail SEZEN over 12 years ago

Andriy Lesyuk wrote:

Note the path app/views/custom_values/list/_license.rhtml.

You mean that?

redmine/vendor/plugins/extended_fields/app/views/custom_values/list/_license.rhtml

#6 Updated by Andriy Lesyuk over 12 years ago

Yes

#7 Updated by Ismail SEZEN over 12 years ago

By the way, I checked out from svn repository and using latest revision.

#8 Updated by Andriy Lesyuk over 12 years ago

_license.rhtml is not a part of Extended Fields it’s my template for License field. It is in my AndriyLesyuk.com plugin (my Redmine customization). The Extended Profile plugin allows you to create such templates for your own fields.

#9 Updated by Ismail SEZEN over 12 years ago

Большое спасибо за ваше терпение, Андрей:)

I’ve got it right now. I did it exactly as you said and in the custom fields section, I chosen list type for format and entered GNU General Public License (GPL) v2.0 text for list element. Then, in the project settings section, I selected it, and voila!

Thank you again for your patience

#10 Updated by Andriy Lesyuk over 12 years ago

:D You’re welcome!

#11 Updated by Andriy Lesyuk over 12 years ago

  • Status changed from In Progress to Closed

Also available in: Atom PDF

Terms of use | Privacy policy