I have created a custom object which contains multiple fields that I want to be able to show on a Visualforce page. From the discussion I've had with another developer it was recommended that I use a utility class and just reference that from the standard class. Here's what I've got.
Utility class
public without sharing class pkb_content_Utility {
public PKB_Content__c pos{get;set;}
public pkb_Controller() {
pos = [SELECT Home_Forum__c FROM PKB_Content__c];
}
}
While I only reference Home_Forum__c, there are multiple other fields I need to reference as well but I am unsure of the best way to do this.
Main controller class
pos = pkb_content_Utility.pkb_Controller();
Visualforce code
<apex:page showHeader="false" standardController="KnowledgeArticle" extensions="pkb_Controller">
<apex:outputText value="{!pos.Home_Forum__c}"/>
</apex:page>