- Posts: 404
COMMUNITY FORUM
Adding HTML code into Extra Fields
- Odin Mayland
- Offline
- Platinum Member
Less
More
13 years 4 months ago #76463
by Odin Mayland
Replied by Odin Mayland on topic Adding HTML code into Extra Fields
I think that the terminology and naming of k2 features is getting confusing. Maybe some screenshots would help.
Please Log in or Create an account to join the conversation.
- matthew turner
- Offline
- Senior Member
Less
More
- Posts: 66
13 years 4 months ago #76464
by matthew turner
Replied by matthew turner on topic Adding HTML code into Extra Fields
Hi Modernmagic,
Just a thought but this could easily be done without using a plug in (which negates the need to fix/hack something....)
Have you tried using the built in "Link" extra field, with show in a light box as the display option, then use CSS to hide the text/replace with icon ?
Just a thought but this could easily be done without using a plug in (which negates the need to fix/hack something....)
Have you tried using the built in "Link" extra field, with show in a light box as the display option, then use CSS to hide the text/replace with icon ?
Please Log in or Create an account to join the conversation.
- Odin Mayland
- Offline
- Platinum Member
Less
More
- Posts: 404
13 years 4 months ago #76465
by Odin Mayland
Replied by Odin Mayland on topic Adding HTML code into Extra Fields
Mat, gee that's a good idea too! :-) seriously.
I will give it a try but my issue doesn't seem to be what is in the box, it seems to be that the info in the box is not getting sent to the k2 item extra field.
I will give it a try but my issue doesn't seem to be what is in the box, it seems to be that the info in the box is not getting sent to the k2 item extra field.
Please Log in or Create an account to join the conversation.
- matthew turner
- Offline
- Senior Member
Less
More
- Posts: 66
13 years 4 months ago #76466
by matthew turner
Replied by matthew turner on topic Adding HTML code into Extra Fields
Hi Modernmagic,
Thanks :) I try not to do core hacks as it means re doing things for clients when doing updates etc...
I have spent the last couple of hours on this and I think it is a Json encode specific issue (try searching google :json encode html) as it is used by K2 to create tidy extrafield arrays that can be stored in the database and called into the template in pairs - name, value, which means lots of core hacks to alter and could lead to a security issue......not a good thing !
I think that this is why Joomlaworks created the link extrafield the way that they did - because it works with the Json encode system, rather than overriding it (by splitting the html into seperate blocks : link text, url etc then arranging them inside of the html afterwards)
I did try all of the "hacks" in these posts (and more from my previous projects and some googling), and got varied results but no complete success..
Thanks :) I try not to do core hacks as it means re doing things for clients when doing updates etc...
I have spent the last couple of hours on this and I think it is a Json encode specific issue (try searching google :json encode html) as it is used by K2 to create tidy extrafield arrays that can be stored in the database and called into the template in pairs - name, value, which means lots of core hacks to alter and could lead to a security issue......not a good thing !
I think that this is why Joomlaworks created the link extrafield the way that they did - because it works with the Json encode system, rather than overriding it (by splitting the html into seperate blocks : link text, url etc then arranging them inside of the html afterwards)
I did try all of the "hacks" in these posts (and more from my previous projects and some googling), and got varied results but no complete success..
Please Log in or Create an account to join the conversation.
- josh tischer
- Offline
- New Member
Less
More
- Posts: 5
13 years 4 months ago #76467
by josh tischer
Replied by josh tischer on topic Adding HTML code into Extra Fields
So according to your screenshot its not showing in the Category display right?
Have you checked to make sure that the extra fields are displayed in the Category listings?
modernmagic said:
I think that the terminology and naming of k2 features is getting confusing. Maybe some screenshots would help.
Have you checked to make sure that the extra fields are displayed in the Category listings?
modernmagic said:
I think that the terminology and naming of k2 features is getting confusing. Maybe some screenshots would help.
Please Log in or Create an account to join the conversation.
- Odin Mayland
- Offline
- Platinum Member
Less
More
- Posts: 404
13 years 4 months ago #76468
by Odin Mayland
Replied by Odin Mayland on topic Adding HTML code into Extra Fields
Under "Item view options" the extrafields is set to show for both the categories.
I got it working. Here are the steps I have to take.
1. open Item
2. click save
That's all I did and now when I check the front end, the extra fields show up as they should. Of course the problem is that I would have to go through all the items to "update" them so that they show the extra fields.
That makes me think that there is a db of data that I am unable to purge if I make a change to the extra fields.
I got it working. Here are the steps I have to take.
1. open Item
2. click save
That's all I did and now when I check the front end, the extra fields show up as they should. Of course the problem is that I would have to go through all the items to "update" them so that they show the extra fields.
That makes me think that there is a db of data that I am unable to purge if I make a change to the extra fields.
Please Log in or Create an account to join the conversation.
- Odin Mayland
- Offline
- Platinum Member
Less
More
- Posts: 404
13 years 4 months ago #76469
by Odin Mayland
Replied by Odin Mayland on topic Adding HTML code into Extra Fields
Mat,
The problem with this solution is that the "lightbox" displays the image at too small of a size to read the text.
nonumbers.com 's Modalizer extension allows me to display the popup with colorbox which looks like this:
At this point the Modalizer code is working but it required a core hack to allow code in the textarea.
So if I could make the lightbox fill the screen with the image then I would figure out how to add an icon to the link extrafield and use this method.
mat said:
Hi Modernmagic,
Just a thought but this could easily be done without using a plug in (which negates the need to fix/hack something....)
Have you tried using the built in "Link" extra field, with show in a light box as the display option, then use CSS to hide the text/replace with icon ?
The problem with this solution is that the "lightbox" displays the image at too small of a size to read the text.
nonumbers.com 's Modalizer extension allows me to display the popup with colorbox which looks like this:
At this point the Modalizer code is working but it required a core hack to allow code in the textarea.
So if I could make the lightbox fill the screen with the image then I would figure out how to add an icon to the link extrafield and use this method.
mat said:
Hi Modernmagic,
Just a thought but this could easily be done without using a plug in (which negates the need to fix/hack something....)
Have you tried using the built in "Link" extra field, with show in a light box as the display option, then use CSS to hide the text/replace with icon ?
Please Log in or Create an account to join the conversation.
- matthew turner
- Offline
- Senior Member
Less
More
- Posts: 66
13 years 4 months ago #76470
by matthew turner
Replied by matthew turner on topic Adding HTML code into Extra Fields
Hi Modernmagic,
I will look into that... must be a way of altering/overriding the Lightbox size.
I tend to resize images to 800x600 so have not had any issues.. I will look at this in the morning
I will look into that... must be a way of altering/overriding the Lightbox size.
I tend to resize images to 800x600 so have not had any issues.. I will look at this in the morning
Please Log in or Create an account to join the conversation.
- matthew turner
- Offline
- Senior Member
Less
More
- Posts: 66
13 years 4 months ago #76471
by matthew turner
Replied by matthew turner on topic Adding HTML code into Extra Fields
Hi Modernmagic,
Another alternative....
If this is to be the same "icon" modalizer plugin for all of the items within a category(s), and you dont want to have to manually add it to every item in the category individually.....
Create/edit an override template for the category, add the code to run a Custom Code module ( from Joomlaworks) within the k2 item template, this module can execute plugins, and PHP - it has worked on all the plugins that I have needed to run so far....so in theory should work for this situation too.. ;)
Set the module to display in all pages or just the menu link for the required category...
And all items within the category now have the icon and the plugin as required - and only 1 file to edit : item.php and 1 module to maintain/edit
Let me know if you need the module in item.php code snippet....
Another alternative....
If this is to be the same "icon" modalizer plugin for all of the items within a category(s), and you dont want to have to manually add it to every item in the category individually.....
Create/edit an override template for the category, add the code to run a Custom Code module ( from Joomlaworks) within the k2 item template, this module can execute plugins, and PHP - it has worked on all the plugins that I have needed to run so far....so in theory should work for this situation too.. ;)
Set the module to display in all pages or just the menu link for the required category...
And all items within the category now have the icon and the plugin as required - and only 1 file to edit : item.php and 1 module to maintain/edit
Let me know if you need the module in item.php code snippet....
Please Log in or Create an account to join the conversation.
- Johnno Church
- Offline
- New Member
Less
More
- Posts: 1
13 years 2 months ago #76472
by Johnno Church
Replied by Johnno Church on topic Adding HTML code into Extra Fields
Hi there, I am trying to insert a table into the extra field of my K2 category and find myself pulling teeth over this. I have scoured many threads and attempted many hacks with zero success. The code is stripped and displayed as plain text. I am using K2 2.4.1 just to let you know. I would really like your advice as I am not fluent with .php...Thanks in advance...
Please Log in or Create an account to join the conversation.