Keyword

extra fields

More
12 years 5 months ago #65313 by jatin
extra fields was created by jatin
hi.....
I need to hide some of the k2 extra fields from front end user while giving him permissions to edit his own items.
That means the user can not see all the extra fields in edit item window.
any help??
Thanx in advance :)

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

More
12 years 5 months ago #65314 by Alan Sparkes
Replied by Alan Sparkes on topic Re: extra fields
I see two choices.
Either hide the elements with CSS display:none

of create a custom template for user and omit them via php from the extrafields loop
eg in the
foreach loop you could skip fields for a specific extrafield id and user group/id

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

More
12 years 5 months ago #65315 by william white
Replied by william white on topic Re: extra fields
@Alan, thanks for replying, we could sure use your help and expertise here!

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

More
12 years 5 months ago #65316 by jatin
Replied by jatin on topic Re: extra fields
Thanx Alan for your reply
It can be done using CSS but I think the edit popup window creates a view from admin so if i mess with for each loop it will also affect view in admin.
I am new to k2 so what i understood is this only.
so please tell me if you can specify the files i have to edit for a dynamic solution.
thank you

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

  • Andrey Miasoedov
  • Andrey Miasoedov's Avatar
  • Offline
  • Senior Member
More
12 years 5 months ago #65317 by Andrey Miasoedov
Replied by Andrey Miasoedov on topic Re: extra fields
Jatin,

You can use $mainframe->isSite() to check if you in backend.

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

More
12 years 5 months ago #65318 by jatin
Replied by jatin on topic Re: extra fields
@Andrey Miasoedov
actually i have to hide some extrafields from item edit view(the popup window where a user can edit his own item) in front end
well i will check for your suggestion :)
thanx for reply but i am not getting the way to do it.

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

More
12 years 5 months ago #65319 by jatin
Replied by jatin on topic Re: extra fields
Thanx I got it using $mainframe->issite()
Thank you for your reply

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

More
12 years 5 months ago #65320 by Peter
Replied by Peter on topic Re: extra fields
Hi guys,

this is a little bit off-topic, but it fits the thread title and i dont wanna spam the forum with new threads...

The problem i have is since i upgraded from k2 2.5.4 to 2.5.5 and even on 2.5.6 it still persitst.

If i add an extrafield which is a "link" field it and hit save

it saves automaticly the "http://" in the sql database...

if i now create an k2 item where this extra field is assigned too and i don't enter any value (no link)

it will show on frontpage for the item http:// as clickable and redirects only to http:// because there is no link entered.

i use this function for my blog to add links like: source, via, Developer Homepage and so on...but i don't always use all the fields.

So every time i add or modify a field i have to go into the sql database and delete the "http" manually...

could you make it like before, that k2 is ignoring the "http://" if nothing else is entered or the best thing would be, delete this function at all. that it doesn't enter the http prefix at all in the database...

can you tell me where i can do this?

Thanks a lot

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

More
12 years 5 months ago #65321 by william white
Replied by william white on topic Re: extra fields
It would be best not to change the way k2 works, but override the view and exclude the extra field from showing if there is no value
In this case i think you would test for extra field = "http://"
alternatively you could just test for the extra field name

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

More
12 years 5 months ago #65322 by Peter
Replied by Peter on topic Re: extra fields
@William White

can you explain this more. I am not a coder, so i am not to familiar with that stuff. But why not change this "bad" K2 behavior. Obiously it is a bug of K2.
As far as i can understand, i have to exclude every extra item seperatly. That is probably almost the same work as going into the database and delete this "http" prefix.
it was working fine in 2.5.4 so somehting changed in the other verisons with that.
It is just a headache, if you modify fields or add them that you have to mess with your database...
Or is there a way that i can alter it, that K2 doesn't automaticly insert this http://? So you don't have to include it in the offical K2 releases.
And I like the idea, that the extra fields with no data will be excluded automaticly (that was, how it worked in 2.5.4) I think that is the way to go. but how can i achieve this?
Will there be an ofical update or just custom work for who ever wants it?

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


Powered by Kunena Forum