Creating the Job Detail Page

,

Visitors to your Force Platform site can search for job postings and see them in a list, but you also want them to be able to drill-down to see the details for individual positions. To accomplish this, you need to provide links to positions on the PublicJobs page, as well as create a Job Details page. In this example, by leveraging the functionality built in to the standard controller—for basic operations, such as editing, deleting, cloning, etc.—you only have to code the Visualforce page.

First, create the PublicJobDetails page in Visualforce. Your Visualforce page should look like this:

<apex:page standardController="Position__c" title="Job Details"
    showHeader="false" standardStylesheets="true">
<!-- The site template provides the site layout and style -->
<apex:composition template="{!$Site.Template}">
<apex:define name="body">
  <apex:form>
  <apex:sectionHeader title="{!$ObjectType.Position__c.label}"
      subtitle="{!Position__c.name}"/>
    <!-- Breadcrumb link back to the search page -->
    <apex:outputLink value="<- Back to Search"
        onclick="top.history.go(-1);return false;" />
      <apex:pageBlock title="Job Detail">
        <apex:pageBlockButtons>
          <!-- The Apply button is linked to the job application
              page in a later step -->
          <apex:commandButton value="Apply" onclick="#"/>
        </apex:pageBlockButtons>
        <!-- Job details -->
        <apex:pageBlockSection title="Information"
            collapsible="false" columns="1">
          <apex:outputField value="{!Position__c.name}"/>
          <apex:outputField value=
              "{!Position__c.Location_City_State_Country__c}"/>
          <apex:outputField value="{!Position__c.Status__c}"/>
          <apex:outputField value=
              "{!Position__c.Position_type__r.Name}"/>
          <apex:outputField value="{!Position__c.Department__c}"/>
          <apex:outputField value="{!Position__c.Start_Date__c}"/>
          <apex:outputField value=
              "{!Position__c.Programming_Languages__c}"/>
          <apex:outputField value=
              "{!Position__c.Job_Description__c}" />
          <apex:outputField value=
              "{!Position__c.Responsibilities__c}" />
          <apex:outputField value=
              "{!Position__c.Educational_Requirements__c}" />
        </apex:pageBlockSection>
      </apex:pageBlock>
  </apex:form>
</apex:define>
</apex:composition>
</apex:page>

Make sure to enable the PublicJobDetails page for your site, as you did for the PublicJobs page you created earlier.

Now that you have the page, update the PublicJobs page to include Position ID links that take users to the PublicJobDetails page by doing the following:

1.
Click Setup Develop Sites.

2.
Click the site label link for your site. This takes you to the Site Details page.

3.
On the Site Pages related list, click the PublicJobs link.

4.
Click Edit.

5.
Replace the following line:

<apex:outputText value="{!Position__c.name}"/>

with this new one:

<apex:outputLink value="PublicJobDetails?id={!Position__c.id}"
							id="theLink">{!Position__c.name}</apex:outputLink>

6.
Click Save.

Browse to your site’s URL to see that the Position IDs show up as hyperlinks.

Figure 217. Job Postings Page with Linked Position IDs


Click a position link to drill down to that job’s detail page. But what happens when a user clicks that Apply button? Right now, nothing. You tackle that in the next section.

Figure 218. Job Details Page


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.116.112