1. REGISTRATION REQUIREMENTS:

    Your username here MUST MATCH your XenForo username (connected to your XF license).

    Once you have registered here, then you need to 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.

Custom Field Array (W/O) HTML

Discussion in 'Showcase Support' started by smartpixels, Aug 10, 2013.

  1. smartpixels

    smartpixels New Member Showcase

    I am trying to display custom fields outside of the item view page and I need a query to get custom fields without their value HTML.

    I saw this post by @Bob B but I think that pass on the HTML as well(whatever we used in value HTML).
     
  2. Bob

    Bob Developer Staff Member

    The only place I expose custom fields is on the Item view.

    Are you grabbing a single item or multiple items?

    If you are grabbing a single item (with the proper get method), then you can grab that items custom fields by using the get, prepare and group methods in the Showcase Custom Field Model (example below is how I grab and format them for the Item page).

    PHP:
            $customFields $scCustomFieldModel->prepareCustomFields($scCustomFieldModel->getCustomFields(
                array(
    'category' => $item['category_id']),
                array(
    'valueItemId' => $item['item_id'])
            ));
           
            
    $customFieldsGrouped $scCustomFieldModel->groupCustomFields($customFields);
    If you have an array of items, then you are going to have to loop through that array and run the above for each item and add the customFieldsGroup array to the item array.

    If there is not a method in the CustomField Model to do what you want, you will have to write your own method(s).

    If that isn't the type of into you were after, you'll need to explain more details (feel free to inbox if you don't want to talk about it publicly)

    -B
     
    smartpixels likes this.
  3. MattW

    MattW Server Admin AMS Premium CAS Premium RMS Premium SC Premium UBS Premium

    smartpixels likes this.
  4. smartpixels

    smartpixels New Member Showcase

    I am trying to do the exact same thing as powerboard using google charts API.

    Arranging content according to custom fields is important and with no indexing of custom fields people will find it difficult to filter content
     
  5. MattW

    MattW Server Admin AMS Premium CAS Premium RMS Premium SC Premium UBS Premium

    OK, I'll put something together later on this afternoon for you.
     
    smartpixels and Bob like this.
  6. smartpixels

    smartpixels New Member Showcase

    Thank You. Eager to see what you come up with.
     
  7. MattW

    MattW Server Admin AMS Premium CAS Premium RMS Premium SC Premium UBS Premium

    Putting some instructions together now.
     
  8. MattW

    MattW Server Admin AMS Premium CAS Premium RMS Premium SC Premium UBS Premium

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.