[Solved] How can I call news module custom fields?
[Solved] How can I call news module custom fields?
I need to call the custom fields in the news module templates, but {$entry->fieldname} does not work. How can I do it?
Thanks in advance
Thanks in advance
Last edited by Torpedine on Fri May 30, 2014 11:08 am, edited 1 time in total.
Re: How can I call new module custom fields?
I think it changed to {$entry->fields.fieldname}.
As usual you can find what is available with {get_template_vars} and {$<whatervervarname>|print_r}.
I believe {$entry->fields|print_r} will give some clues to what you need.
HTH.
As usual you can find what is available with {get_template_vars} and {$<whatervervarname>|print_r}.
I believe {$entry->fields|print_r} will give some clues to what you need.
HTH.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Re: How can I call new module custom fields?
I tried {$entry->fields.fieldname} - Using the field name {$entry->fields.Provincia}, but the output is a non formatted page without template...
Re: How can I call new module custom fields?
Sorry my bad... try {$entry->fields->Provincia}. This syntax worked on a test I just did.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Re: How can I call new module custom fields?
It seems I cannot display anything.
I tried {$entry->fields->fieldname} but nothing is displayed. I tried with the capitalised version of the field (Provincia) and the uncapitalised one (provincia)
I tried {$entry->fields->fieldname} but nothing is displayed. I tried with the capitalised version of the field (Provincia) and the uncapitalised one (provincia)
Re: How can I call new module custom fields?
What template are you using? Summary? Detail?
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Re: How can I call new module custom fields?
Summary, but I have to do something similar also in detail
Re: How can I call new module custom fields?
My 1st answer was almost correct:
I was in a bit of a hurry when I replied before, sorry. This should work in both templates, in the summary template it has to be inside the foreach loop that iterates through all the entries.
If you use {$entry->fields.Provincia|print_r} you will see how to call the other components of the field.
Code: Select all
{$entry->fields.Provincia->value}
If you use {$entry->fields.Provincia|print_r} you will see how to call the other components of the field.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Re: How can I call news module custom fields?
Thank you! It works perfectly!
It should be put in the module help...
It should be put in the module help...
Re: [Solved] How can I call news module custom fields?
The sample templates do have a very comprehensive help text in Smarty comments. May not be easy at 1st but it's all there and once you find your bearings it's not that difficult.Torpedine wrote:It should be put in the module help...
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!