- Posts: 36
COMMUNITY FORUM
How to change position of an extra field?
- Craig Pearson
- Offline
- Junior Member
Less
More
14 years 3 months ago #82352
by Craig Pearson
Replied by Craig Pearson on topic How to change position of an extra field?
This is great, and it works but my question is - is it possible to still keep the Additional info fields below but omit the one you have isolated?
Svein Wisnaes said:Looks like this code did the trick so far! Had to clean cache to get it to show.
The strange thing is that even if I do not have any condition for showing it, it still responds to the Extrafields setting for the category. But as I only have this single extrafield in this project so far, I commented out the extrafields code at the bottom of the page. So It works :-)
Will get back with more info if I find something out!
Svein Wisnaes said:Looks like this code did the trick so far! Had to clean cache to get it to show.
The strange thing is that even if I do not have any condition for showing it, it still responds to the Extrafields setting for the category. But as I only have this single extrafield in this project so far, I commented out the extrafields code at the bottom of the page. So It works :-)
Will get back with more info if I find something out!
Please Log in or Create an account to join the conversation.
- Craig Pearson
- Offline
- Junior Member
Less
More
- Posts: 36
14 years 3 months ago #82353
by Craig Pearson
Replied by Craig Pearson on topic How to change position of an extra field?
Figured out a way.
After you added the isolated fields to your item.php (and I supposed others if you want it to show) find the Additional info area in that file (around 261). Do this to the code (see attachment)
k2codefile.txt
This will add on to the style class using the name of the field you created - now you have an individual style per line.
In my case that would give me .group1Subtitle - I can change the colour or visibility hidden now but if you want to display none then you need to add this whole class to the K2 stylesheet:
div.itemExtraFields ul li.group1Subtitle { display: none; }
To use a display none
Craig Pearson said:This is great, and it works but my question is - is it possible to still keep the Additional info fields below but omit the one you have isolated? Svein Wisnaes said:Looks like this code did the trick so far! Had to clean cache to get it to show. The strange thing is that even if I do not have any condition for showing it, it still responds to the Extrafields setting for the category. But as I only have this single extrafield in this project so far, I commented out the extrafields code at the bottom of the page. So It works :-) Will get back with more info if I find something out!
After you added the isolated fields to your item.php (and I supposed others if you want it to show) find the Additional info area in that file (around 261). Do this to the code (see attachment)
k2codefile.txt
This will add on to the style class using the name of the field you created - now you have an individual style per line.
In my case that would give me .group1Subtitle - I can change the colour or visibility hidden now but if you want to display none then you need to add this whole class to the K2 stylesheet:
div.itemExtraFields ul li.group1Subtitle { display: none; }
To use a display none
Craig Pearson said:This is great, and it works but my question is - is it possible to still keep the Additional info fields below but omit the one you have isolated? Svein Wisnaes said:Looks like this code did the trick so far! Had to clean cache to get it to show. The strange thing is that even if I do not have any condition for showing it, it still responds to the Extrafields setting for the category. But as I only have this single extrafield in this project so far, I commented out the extrafields code at the bottom of the page. So It works :-) Will get back with more info if I find something out!
Please Log in or Create an account to join the conversation.
- Oceanwatcher
- Offline
- Elite Member
Less
More
- Posts: 175
14 years 3 months ago #82354
by Oceanwatcher
Replied by Oceanwatcher on topic How to change position of an extra field?
Great news Craig!
Right now, I only needed one field, so I just commented out the rest, but I might have to bring it back and use your method later. Thanks! :-)
And Viktoria - sorry for hijacking your topic here, but as it all was in the same direction, I hope you do not mind too much :-)
Craig Pearson said:Figured out a way.
Right now, I only needed one field, so I just commented out the rest, but I might have to bring it back and use your method later. Thanks! :-)
And Viktoria - sorry for hijacking your topic here, but as it all was in the same direction, I hope you do not mind too much :-)
Craig Pearson said:Figured out a way.
Please Log in or Create an account to join the conversation.
- william white
- Offline
- Platinum Member
Less
More
- Posts: 3722
14 years 3 months ago #82355
by william white
Replied by william white on topic How to change position of an extra field?
Another way would be to go into the foreach loop for xtra fields. and put and if statement around the part that displays the name and value and say something like
if this extra field value != "name of field you want to leave out"
do the display
endif
this would work nicely in an override.....
If you have created another css style with the above code.txt then you could use css4k2 and have the hidden in the override_style.css as well
if this extra field value != "name of field you want to leave out"
do the display
endif
this would work nicely in an override.....
If you have created another css style with the above code.txt then you could use css4k2 and have the hidden in the override_style.css as well
Please Log in or Create an account to join the conversation.