-
AuthorPosts
-
Mr.Cat Moderator
Mr.Cat
- Join date:
- December 2016
- Posts:
- 270
- Downloads:
- 24
- Uploads:
- 69
- Thanks:
- 58
- Thanked:
- 53 times in 50 posts
October 2, 2017 at 4:25 am #1065200Which componet do you use to filter? And what kind of custom fields you want to show?
So i can help you to do some hard code to show custom field as you want.
Regards
- This reply was modified 7 years, 1 month ago by Mr.Cat.
- This reply was modified 7 years, 1 month ago by Mr.Cat.
Wisdom is not a product of schooling but of the lifelong attempt to acquire it.
mypoolitzer Friendmypoolitzer
- Join date:
- September 2017
- Posts:
- 13
- Downloads:
- 4
- Uploads:
- 3
- Thanked:
- 2 times in 2 posts
October 2, 2017 at 7:27 am #1065243I use the com_content. The fields are: text, number, list, picture, radio.
In my article override i use the custom output of the custom fields too.
At the top of article.php i drop this code:<?php $myCustomFields = array(); foreach($this->item->jcfields as $field) { $myCustomFields[$field->name]['value'] = $field->value; $myCustomFields[$field->name]['label'] = $field->label; } ?>
and then in the place i want:
<?php echo $myCustomFields['werke-roman-titel']['label']; echo " : "; echo $myCustomFields['werke-roman-titel']['value']; ?>
Is it maybe possible, to use approximately the same way for Mega Filter?
Mr.Cat ModeratorMr.Cat
- Join date:
- December 2016
- Posts:
- 270
- Downloads:
- 24
- Uploads:
- 69
- Thanks:
- 58
- Thanked:
- 53 times in 50 posts
October 2, 2017 at 10:13 am #1065286Nice.
We’re using dustjs to show data to frontend so it’s a bit different.
First, you have to know the id of custom field you want to show. You can get it at fields managenment at backend.
For different types, we have different ways to show data.
With type is ‘text’ , you can simple put this code to product-item.php and data will show.
{attr.ct3.frontend_value}
you can see, "3" is the id of your custom field
With types are number, list, picture, radio , use this code
{#attr.ct4.frontend_value} <p>{.}</p> {/attr.ct4.frontend_value}
You can see, "4" is your custom field id, "{.}" is your custom field value.
Try and let me know if it works 🙂
- This reply was modified 7 years, 1 month ago by Mr.Cat.
Wisdom is not a product of schooling but of the lifelong attempt to acquire it.
mypoolitzer Friendmypoolitzer
- Join date:
- September 2017
- Posts:
- 13
- Downloads:
- 4
- Uploads:
- 3
- Thanked:
- 2 times in 2 posts
October 2, 2017 at 1:02 pm #1065321Thank you! Generally it works. There is only the problem with the image field:
The output from the image custom field seems to be the path to the image.
So i wrote the code in this kind:{#attr.ct13.frontend_value}<img src="{.}" alt="" />{/attr.ct13.frontend_value}
It’s probably wrong. There is no image to see in front end 🙁
Here i need you help.Further i have following Question:
How can i get the label of the custom field
With this try i had no success:{attr.ct14.frontend_label}
mypoolitzer Friendmypoolitzer
- Join date:
- September 2017
- Posts:
- 13
- Downloads:
- 4
- Uploads:
- 3
- Thanked:
- 2 times in 2 posts
October 2, 2017 at 1:15 pm #1065324I think I’ve found the cause of the error with the output of the image custom field.
If i place the code in the img tag (see post above), the path to the image until the file-name is repeated.
See attachement. How can we fix this problem?
Mr.Cat ModeratorMr.Cat
- Join date:
- December 2016
- Posts:
- 270
- Downloads:
- 24
- Uploads:
- 69
- Thanks:
- 58
- Thanked:
- 53 times in 50 posts
October 3, 2017 at 1:56 am #1065394To get correct image url, use this code
<?php echo JUri::root(true) ?>/{.}
About label of custom field, you can try this code with "Addition Info" must be published on filter config.
{attr.ct4.title}
Regards!
- This reply was modified 7 years, 1 month ago by Mr.Cat.
Wisdom is not a product of schooling but of the lifelong attempt to acquire it.
mypoolitzer Friendmypoolitzer
- Join date:
- September 2017
- Posts:
- 13
- Downloads:
- 4
- Uploads:
- 3
- Thanked:
- 2 times in 2 posts
October 3, 2017 at 10:03 am #1065508… no luck with both proposals …
The image path is now extended, but is still repeated (see attachement).
The output of custom field label with code you posted doesn’t work. The output is empty …
Addition Info is enabled- This reply was modified 7 years, 1 month ago by mypoolitzer.
Mr.Cat ModeratorMr.Cat
- Join date:
- December 2016
- Posts:
- 270
- Downloads:
- 24
- Uploads:
- 69
- Thanks:
- 58
- Thanked:
- 53 times in 50 posts
October 4, 2017 at 1:00 am #1065586Can you give me your site access info in private reply for further checking?
Wisdom is not a product of schooling but of the lifelong attempt to acquire it.
mypoolitzer Friendmypoolitzer
- Join date:
- September 2017
- Posts:
- 13
- Downloads:
- 4
- Uploads:
- 3
- Thanked:
- 2 times in 2 posts
October 4, 2017 at 7:22 am #1065689This reply has been marked as private.Mr.Cat ModeratorMr.Cat
- Join date:
- December 2016
- Posts:
- 270
- Downloads:
- 24
- Uploads:
- 69
- Thanks:
- 58
- Thanked:
- 53 times in 50 posts
October 4, 2017 at 7:51 am #1065715There are some bugs on plugin content that we haven’t released yet. I’ve update newest code on your site.
Now the custom field label and media is working now.
Regards
P.S: Please override layout if you heavily modify the code file. Follow the guide here https://www.joomlart.com/documentation/joomla-component/ja-megafilter#override-layout
- This reply was modified 7 years, 1 month ago by Mr.Cat.
- This reply was modified 7 years, 1 month ago by Mr.Cat.
Wisdom is not a product of schooling but of the lifelong attempt to acquire it.
mypoolitzer Friendmypoolitzer
- Join date:
- September 2017
- Posts:
- 13
- Downloads:
- 4
- Uploads:
- 3
- Thanked:
- 2 times in 2 posts
October 4, 2017 at 10:36 am #1065769This reply has been marked as private.mypoolitzer Friendmypoolitzer
- Join date:
- September 2017
- Posts:
- 13
- Downloads:
- 4
- Uploads:
- 3
- Thanked:
- 2 times in 2 posts
October 4, 2017 at 6:04 pm #1065905This reply has been marked as private.Mr.Cat ModeratorMr.Cat
- Join date:
- December 2016
- Posts:
- 270
- Downloads:
- 24
- Uploads:
- 69
- Thanks:
- 58
- Thanked:
- 53 times in 50 posts
October 5, 2017 at 1:46 am #1065969{desc} is back. Sorry for missing code.
You can override by the same way. Just change the string on layout path from "virtuemart" to "content"
Regards
Wisdom is not a product of schooling but of the lifelong attempt to acquire it.
mypoolitzer Friendmypoolitzer
- Join date:
- September 2017
- Posts:
- 13
- Downloads:
- 4
- Uploads:
- 3
- Thanked:
- 2 times in 2 posts
AuthorPostsViewing 14 posts - 1 through 14 (of 14 total)This topic contains 14 replies, has 2 voices, and was last updated by mypoolitzer 7 years, 1 month ago.
The topic ‘Appearance / Output of Custom Fields’ is closed to new replies.
Jump to forum