3/10/2023 0 Comments Php json decode joomla![]() ![]() Let’s write the code to make it easier to access Custom Fields once rather than in every override. The programmer in me says “nope, let’s make it better”. So the core idea and logic how to access fields (directly using jcfields, not the FieldsHelper) is spot on – but the repeated implementation in every override isn’t the best. If we have several overrides and need to make one change to the logic of this processing, we need to update several files. The documentation does also point out how to access the fields by their name – but still relies on placing repeated code at the top of every override. The FieldsHelper method spits out markup in a set (and not-overridable) way – which isn’t good for the control freak in me – and the jcfields index is a numerically indexed array, so accessing a specific field is quite loopy (ha…). Within each Article, we are able to access our Custom Fields using the jcfields array on our $item, and Joomla provide in their documentation the option of simply iterating, or using the FieldsHelper. By using Field Groups, Fields are more logically placed, and lists of Fields appear shorter (making it easier to read and process entire sections) – and the nerd in me loves it because the content of these Fields remains fully separate from the core Article content – meaning I can do what I need to with the content and not have to rely on accuracy of markup from the author. The project relied on a rather large number of Custom Fields – and by using the combination of Field Groups and Categories has created an incredibly easy-to-manage editing experience for the site’s authors. Michael, Mity Digital’s in-house Certified Joomla Administrator with over a decade of Joomla experience, introduced me to Custom Fields for a specific project – and the value it adds to the author is incredible – he’s written a blog post all about the benefits of Custom Fields for Joomla content authors. Joomla is such a powerful, flexible and user-friendly CMS to work with, but did find a few harder-than-they-need-to-be moments. Over the past few years, I’ve had to get more and more involved in developing Joomla websites. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |