- Posts: 1
COMMUNITY FORUM
mod_k2_content Customization Questions
- Brady Fopma
- Topic Author
- Offline
- New Member
Less
More
14 years 7 months ago #81714
by Brady Fopma
mod_k2_content Customization Questions was created by Brady Fopma
Hi, I have a few questions regarding customizing the template for mod_k2_content:1) Is there any way to pull out the current item's fulltext? Basically, I want to access the main textarea of the K2 item but I haven't figured out how to do this.2) Is there a way to access an Extra Field directly in the template? For example, I have an extra field called 'Price'. I want to display the contents of this field in a specific location in the template. Is there any way that I can access it directly without looping through all of the extra fields?3) Is there a way to allow the user to upload an image and prevent any image processing to it? For example, I would like to upload a .png and retain the image's dimensions and transparency. Is there a way to do this?Thanks in advance for any help that you can provide!Brady
Please Log in or Create an account to join the conversation.
- scyllar
- Offline
- Senior Member
Less
More
- Posts: 60
14 years 7 months ago #81715
by scyllar
Replied by scyllar on topic mod_k2_content Customization Questions
hi brady i try my best :)
1) Clue only: please take a look at file modules\mod_k2_content\helper.php about line 270
you may need to change introtext to fulltext, but as i did not test it so i don't know if it works, also you might need to remove the wordlimit challenge in the line above it.
2) Nope: as i understand it you cannot move around your price field around alone. if you reposition it, you reposition the whole extra field block.
BUT you could hack the database by adding a price column into table #_k2_items, but this way you will need to find out what files associated to it and modify it. Grep a unique word for items (like fulltext) maybe accomplish this.
3)sorry don't know. what happened to your png file? does it get renamed to jpg? you may check the media\k2 folder to find out. if it is a dimension matter you could override it in the template files.
1) Clue only: please take a look at file modules\mod_k2_content\helper.php about line 270
you may need to change introtext to fulltext, but as i did not test it so i don't know if it works, also you might need to remove the wordlimit challenge in the line above it.
2) Nope: as i understand it you cannot move around your price field around alone. if you reposition it, you reposition the whole extra field block.
BUT you could hack the database by adding a price column into table #_k2_items, but this way you will need to find out what files associated to it and modify it. Grep a unique word for items (like fulltext) maybe accomplish this.
3)sorry don't know. what happened to your png file? does it get renamed to jpg? you may check the media\k2 folder to find out. if it is a dimension matter you could override it in the template files.
Please Log in or Create an account to join the conversation.
- Markus
- Visitor
14 years 7 months ago #81716
by Markus
Replied by Markus on topic mod_k2_content Customization Questions
Hi,
2) you can access every extra field via:
echo $this->item->extra_fields[0]->name;
echo $this->item->extra_fields[0]->value;
0 is the first extrafield in your Group
1 is the SECOND extrafield in your group
I hope u understand this.
2) you can access every extra field via:
echo $this->item->extra_fields[0]->name;
echo $this->item->extra_fields[0]->value;
0 is the first extrafield in your Group
1 is the SECOND extrafield in your group
I hope u understand this.
Please Log in or Create an account to join the conversation.
- scyllar
- Offline
- Senior Member
Less
More
- Posts: 60
14 years 7 months ago #81717
by scyllar
Replied by scyllar on topic mod_k2_content Customization Questions
You rock man! Keep this noted. thanks
Devil said:Hi,
2) you can access every extra field via:
echo $this->item->extra_fields[0]->name;
echo $this->item->extra_fields[0]->value;
0 is the first extrafield in your Group
1 is the SECOND extrafield in your group
I hope u understand this.
Devil said:Hi,
2) you can access every extra field via:
echo $this->item->extra_fields[0]->name;
echo $this->item->extra_fields[0]->value;
0 is the first extrafield in your Group
1 is the SECOND extrafield in your group
I hope u understand this.
Please Log in or Create an account to join the conversation.
- BBC
- Offline
- Platinum Member
Less
More
- Posts: 663
14 years 3 weeks ago #81718
by BBC
Replied by BBC on topic mod_k2_content Customization Questions
Stupid forum software. Most important part from last post it cuted.
Please Log in or Create an account to join the conversation.
- Yiota
- Visitor
14 years 3 weeks ago #81719
by Yiota
Replied by Yiota on topic mod_k2_content Customization Questions
1) On the mod_k2_content override file try "echo $item->fulltext; "
2) The location on the template is inside the k2 (are you referring to a K2 template) just in a different place of all the other extrafields?
3) I'm afraid not.
2) The location on the template is inside the k2 (are you referring to a K2 template) just in a different place of all the other extrafields?
3) I'm afraid not.
Please Log in or Create an account to join the conversation.