Keyword

Title for Extra Field Group to replace generic sounding Additional Info?

  • EasiStudio
  • EasiStudio's Avatar Topic Author
  • Offline
  • Junior Member
More
13 years 2 months ago #99148 by EasiStudio
Now starting to get to grips with K2 and have a suggestion for future releases.

Instead of having 'Additional Info' above the extra fields, instead have the name of the Extra Field Group that they are from or perhaps create an extra field within Extra Field Groups to accommodate a title for this additional information. The term 'Additional Info' is a bit generic.

Please Log in or Create an account to join the conversation.

More
13 years 2 months ago #99149 by william white
Create anoverride

Open the newly created item.php file

Search for <h3><?php echo JText::_('Additional Info'); ?></h3> (around line 250-260

Change the wording

You will also find this wording in other files for other views like category_item.php - you can change it there also

Please Log in or Create an account to join the conversation.

  • EasiStudio
  • EasiStudio's Avatar Topic Author
  • Offline
  • Junior Member
More
13 years 2 months ago #99150 by EasiStudio
Thanks for this information, very useful.

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago #99151 by esther
Where exaclty can I locate the item.php file in com_k2 directory.

The only one I have have found displays: <h3><?php echo JText::_('K2_ADDITIONAL_INFO'); ?></h3>.
However, changing the above text did nothing.
I'm new to php, please bare with me.

I appreciate the help.

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago #99152 by william white
Another way to do it is to
Create a file
Your SiteRoot/languages/overrides/en-GB.override.ini
and place this line of code in it
K2_ADDITIONAL_INFO="What you want here"

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago #99153 by Mary Stremmel
I did exactly what you want for the nbwcc.com website:

for member profiles I changed the language file:

Here is my profiles: www.nbwcc.com/component/k2/item/2-fusion-web-marketing.html

For Member Offers I changed the custom "Offer" profile

item.php around line 253

<div class="itemExtraFields">
<h3><?php echo JText::_('NBWCC Member to Member Offers:'); ?></h3>
<ul>

Here is my offer listing:
www.nbwcc.com/component/k2/item/41-free-facebook-tab.html

Thanks K2 for making this membership site possible. I moved away from standard Joomla articles because it was so time consuming and this way with K2 I can give each member the opportunity to update their own profile and their own offer 24/7

Please Log in or Create an account to join the conversation.

More
11 years 6 months ago #99154 by Naoufal EL Hilali
Hi,

Could you please detail me the code to override the word "Additional Info" and to display the Extra Fields Group Name ?

I would much appreciate your help.

Thank you very much

Naoufal El Hilali
This email address is being protected from spambots. You need JavaScript enabled to view it.

Please Log in or Create an account to join the conversation.

More
11 years 3 months ago - 11 years 3 months ago #99155 by Milaim Ajdari
Replied by Milaim Ajdari on topic Display Extra Field Group Category Name in K2
@Naoufal EL Hilali
If you take a look into each item in
$this->item->extra_fields
you can see an item parameter called "group".
This is the group ID of the Extra Field Category.

Here is an example how you could get the Extra Field Category Name:
$groupId = (int) $this->item->extra_fields[0]->group;
/* I used the first array index of extra_fields, because every array item has the same groupid in k2. There is only one group allowed in every category. If you use the MEFG Plugin developed by Joomrem, you have to handle each cagetory seperate. */
$db = JFactory::getDBO();
$query = "SELECT `name` FROM #__k2_extra_fields_groups WHERE `id`={$groupId}";
$db->setQuery($query);
$groupName = $db->loadResult();

@K2 Developers: This should be automatically loaded from the getExtraFieldsByGroup function in extrafields.php. I think the Category name is much more important than the groupid. Isnt it?

Best regards
Milaim Ajdari

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum