1. REGISTRATION REQUIREMENTS:

    Register with your xenforo.com Username then start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

How to place custom Item Fields in templates?

By Bob, Apr 27, 2013 | |
  1. Bob

    Bob Developer Staff Member

    Last edited: Jul 6, 2016
  2. C.Birch

    C.Birch Member Article Mgmt System EA User Blogs System EA Showcase EA

    That works, many thanks Bob, now i can have fun setting up some nice info layouts :)
     
    Bob likes this.
  3. Bob

    Bob Developer Staff Member

    Have fun :D and if you run into something that you need help with, just holler!
     
  4. C.Birch

    C.Birch Member Article Mgmt System EA User Blogs System EA Showcase EA

    Will do, have made a start on it, before i used the HTML add-on from Luke to do this, now its just enter a few numbers and not a load of HTML.

    Screen Shot 2013-04-28 at 21.47.45.png Screen Shot 2013-04-28 at 21.48.11.png
     
    MattW and Bob like this.
  5. Bob

    Bob Developer Staff Member

    awesome!!
     
  6. nguy3ndai

    nguy3ndai New Member Showcase

    wow that looks great :)
     
  7. conrad

    conrad New Member Showcase

    Hi Bob,

    Trying to place a custom field into the index and category page under each item.

    Currently only "Title & Description" is visable under each item thumb.... I would like to also show "Location and Price"

    I used {$customFieldsGrouped.tab1.price.field_value} but it does not show.

    Guess self placement only works in the item page?

    Thanks

    C
     
  8. Bob

    Bob Developer Staff Member

    Hi Conrad :)

    Currently, I only expose custom fields on the item view itself. I have a note on my white board to look into exposing them elsewhere, but if you want, you can create a thread in the Suggestions requesting that custom field data be exposed outside of just the item views themselves (ie, in Category View, Member View, Index View etc.).

    -B
     
  9. Bob

    Bob Developer Staff Member

    Custom fields in Showcase 2.0.0 has change dramatically.

    Here is an example on how to use custom fields in Showcase 2.0.0

    This example uses the new HELPERS (Field Title and Field Value). selfplace1 = the custom field ID for this example
    HTML:
    <xen:if is="{$item.customFields.selfplace1}">
        <div class="customShowcaseFields tab1">
            <dl class="customShowcaseFieldselfplace1">
                <dt>{xen:helper showcaseFieldTitle, 'selfplace1'}:</dt>
                <dd>{xen:helper showcaseFieldValue, $item, 'selfplace1', {$item.customFields.selfplace1}}</dd>
            </dl>
        </div>
    </xen:if>
    This is how you'd use the RAW field value
    HTML:
    {$item.customFields.selfplace1}
    This is how you'd use the helper formated field value only.
    HTML:
    {xen:helper showcaseFieldValue, $item, 'selfplace1', {$item.customFields.selfplace1}}
     
  10. Ludachris

    Ludachris Active Member Showcase EA

    Hey Bob, I'm trying to use the helper formatted field value example you posted, but I'm getting "No View Registered" displaying for output.

    Here's my code posted in the nflj_showcase_category_list template:
    HTML:
    <xen:if is="{$item.customFields.vehicle_model_trim}">
             {xen:helper showcaseFieldValue, $item, 'vehicle_year', {$item.customFields.vehicle_year}}
             {xen:helper showcaseFieldValue, $item, 'vehicle_model_trim', {$item.customFields.vehicle_model_trim}}
    </xen:if>
    
    What am I doing wrong?
     
  11. Bob

    Bob Developer Staff Member

    That was one of the little bugs that was fixed in the last version. You can fix that by either upgrading OR downloading the latest version and only uploading the VIEW files (library/NFLJ/Showcase/ViewPublic).
     
  12. Ludachris

    Ludachris Active Member Showcase EA

    Gotcha. Will get around to upgrading soon here. Having too much fun customizing. :)
     
  13. Bob

    Bob Developer Staff Member

    Just upload the newest files for that directory ONLY (uploading other files will be a mismatch and things will be all FUBAR). You can safely upload all the new VIEW files tho.
     
  14. Ludachris

    Ludachris Active Member Showcase EA

    Perfect, thanks.
     
  15. Ludachris

    Ludachris Active Member Showcase EA

    The members are loving showcase BTW. I can't wait to extend it a little more (adding showcase items to postbit or the sig area - have a question in another thread for you on that) and get my Timeslips and Dyno pages built to replace the old pages I had in vB. But overall they're loving having the showcases tied to their existing build threads. ;)
     
  16. Bob

    Bob Developer Staff Member

    Are you doing the pages like @MattW did his?
     
  17. Ludachris

    Ludachris Active Member Showcase EA

    Going to try - actually asked him if he would share his code for that.
     
  18. Market1234

    Market1234 Member Showcase

    How did you add your review boxes like that, please share.
     
  19. C.Birch

    C.Birch Member Article Mgmt System EA User Blogs System EA Showcase EA

    It's a custom star rating script and html, @Bob's got a better way to do it with a later version of Showcase that will have a rating field type you can use.

    How i do it do now is with custom script but it means i have to give each item its own rating id's what means its not something that could be used to let users list items.
     
  20. beanfan78

    beanfan78 Member Article Mgmt System EA Showcase EA

    Bob, I am back and I have been spending a lot of time trying to get the output html box to output something correctly. You tried to help me previously, but your page didn't help or explain in a way I could understand. I can't find what I am looking for here or at xf. I attached what I have. I want to output anchor text to the url. Can you link me to a page that will show me how this box works? I know HTML/CSS, but as my opening thread showed...I still have no idea why the HTML Output box won't accept HTML. It seems straight forward, but it's not. What string do I put there? I know xf has it's own language, but I don't speak it and I can't find a dictionary.
    output-html.jpg