how to call to get custom field value

Laraship QuestionsCategory: Technicalhow to call to get custom field value
nao asked 6 years ago
I have a question. After I add custom field in Custom Fields menu, how do I code to get custom field value in blade.php file?
4 Answers
laraship Staff answered 6 years ago

Hello,

There is no $page variable in the CMS, however there is $item variable which holds the data

nao replied 6 years ago

As you replied, I code $item->foo in blade.php file, but this value doesn’t show.
At var_dump($item), there’s no key of ‘foo’.

laraship Staff answered 6 years ago

This issue should be fixed in Users Module V 1.5.3 where the child object is returned to the view not the Content Class object

nao replied 6 years ago

I installed latest version of User module.
Then I tried to code to show value of custom fields.

nao replied 6 years ago

Under all core modules and CMS module are latest version, I examined to code $item->foo.
But value doesn’t show.
At var_dump(), key ‘foo’ is’t’ contained in $item.

nao replied 6 years ago

Do you have any tips to solve this problem?

laraship Staff replied 6 years ago

We will check and update you

nao replied 6 years ago

Thank you.
I’m waiting for your replying.

nao replied 6 years ago

I updated User Manager module version 1.5.6 and Utility Module version 1.0.4.
But the problem can’t solve.

What things do I confirm at php file?

nao replied 6 years ago

How is current analysis?
Can your company solve this problem?

laraship Staff replied 6 years ago

Hello,

We don’t have an answer yet, we will update you when we have

nao replied 6 years ago

OK, I wait for your answer.

laraship Staff answered 6 years ago

Hello,

We just checked the text field for custom fields and its working for us, so we dont see any issue here

nao replied 6 years ago

Actually how did you check to work property?
Please tell me the way?
Because my way to show value of custom field might be wrong.

I updated version of Base Foundation to 1.7.7, but any keys of custom field don’t contain at $item variables.

laraship Staff replied 6 years ago

I created a custom field with name testtest and I was able to access the value of using $item->testest
CMS 1.7
Setting 2.1.1
Foundation 1.7.7

nao replied 6 years ago

CMS 1.7
Setting 2.1.1
Foundation 1.7.7
These are same as me.

Is this Model of Custom Field ‘Page’?
I created custom field like you, and show $item->testest at data of Pages.
But the value doesn’t show.

What of another settings do I need to check?

laraship Staff replied 6 years ago

Sorry we can’t help any more here, you need to debug your code, we will close this case

laraship Staff answered 6 years ago

Sorry we can't help any more here, you need to debug your code, we will close this case