test
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • Mr.Cat Moderator
    #1065200

    @mypoolitzer

    Which 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 Friend
    #1065243

    I 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 Moderator
    #1065286

    @mypoolitzer

    Nice.

    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 Friend
    #1065321

    Thank 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 Friend
    #1065324

    I 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?


    1. screen-01
    Mr.Cat Moderator
    #1065394

    @mypoolitzer

    To 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 Friend
    #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.

    1. screen-02
    Mr.Cat Moderator
    #1065586

    @mypoolitzer

    Can 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 Friend
    #1065689
    This reply has been marked as private.
    Mr.Cat Moderator
    #1065715

    @mypoolitzer

    There 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 Friend
    #1065769
    This reply has been marked as private.
    mypoolitzer Friend
    #1065905
    This reply has been marked as private.
    Mr.Cat Moderator
    #1065969

    @mypoolitzer

    {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 Friend
    #1066034

    Hi! I see, the {desc} is back again! Super!
    Thank you!

Viewing 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.