• 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

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).
 
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
 
These are some of the things I've done with custom fields outside of showcase, but you need to write your own model and use a PHP callback in the page to get the data to pass into the HTML

http://www.z22se.co.uk/pages/powerboard/
http://www.z22se.co.uk/pages/ownership/

Happy to share that if it's of any use?
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
 
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
OK, I'll put something together later on this afternoon for you.
 
Back
Top