Keyword

php problem

  • Deigo Bocni
  • Deigo Bocni's Avatar Topic Author
  • Offline
  • Junior Member
More
11 years 2 months ago #116291 by Deigo Bocni
php problem was created by Deigo Bocni
i'm using extra fields and i have a particular need.
i associated some link type extra field to a category:
i need them to be invisible to users while they create items from frontend,
but then be visible after i filled those fields from backend.
so i just need to hide those extrafields (all the link type) from the itemform view, below the code where i should add something like IF IT'S A LINK TYPE THEN NOT SHOW THAT EXTRA FIELD! but i don't know nothing about php code compiling... can any body suggest something???

<table class="admintable" id="extraFields">
<?php foreach($this->extraFields as $extraField): ?>
<tr>
<td align="right" class="key">
<?php echo $extraField->name; ?>
</td>
<td>
<?php echo $extraField->element; ?>
</td>
</tr>
<?php endforeach; ?>
</table>

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

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
11 years 2 months ago #116292 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic Re: php problem
Hi Deigo,

Try this code:
<table class="admintable" id="extraFields">
<?php foreach($this->extraFields as $extraField): ?>
<?php if($extraField->type != 'link'): ?>
<tr>
<td align="right" class="key">
<?php echo $extraField->name; ?>
</td>
<td>
<?php echo $extraField->element; ?>
</td>
</tr>
<?php endif; ?>
<?php endforeach; ?>
</table> 

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

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

  • Deigo Bocni
  • Deigo Bocni's Avatar Topic Author
  • Offline
  • Junior Member
More
11 years 2 months ago #116293 by Deigo Bocni
Replied by Deigo Bocni on topic Re: php problem
thank you it's working!

i know that it's not good to straight edit files, because future update would kill the edit.

so i must create a new file with the same name and put it in a new folder, but which one???

this is a plugin, the file i'm editing is in the folder

...\plugins\system\k2multiimages\K2MultiImages\administrator\templates

so where shoud i create and put the new override file???

thanks

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

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
11 years 2 months ago #116294 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic Re: php problem
I'm afraid this is not possible in this plugin.

Its better to ask the developer about that.

If it is not possible, then keep the modifications and apply them whenever you update the plugin.

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

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


Powered by Kunena Forum