Job (Detail Page)
<!--A Detail page is a template to be used for a particular type of content. -->
<!--This code creates a Job Detail page that will be used to display each of your Job Posts. -->
<!--It includes Date, Primary Image (if present), Body, Primary Contact information, and attached Files (if present). -->
<!--The Jobs View doesn't exist so you'll have to create it. -->
<!--The instructions are below.-->
<!--This code block loads a Job Post article.-->
<!--** To use this page you must have an existing "Job Postings" View.**-->
<!--To create the View:-->
<!--In the dashboard main menu, click Admin > Views. You'll see a list of your existing views. -->
<!--If you don't see the "JobPostings" view, don't worry - we can create it easily.-->
<!--Click the green "+New" button on the right side and select "I'd like to create a new type of Content". -->
<!--Enter the name "Job Postings" (without the quote marks) and click Create.-->
<!--Save the view and you're done.-->
@BRT.Detail(tableId: "Content", viewId: "JobPostings",
fields: new[] {"Title","PubDate","PrimaryImage","Body","PrimaryContact","Location","Address1","Address2","City","State","Zip","Phone","Email","Files"},
template:
@<article class="detailpage">
<div>
<small class="text-muted">
@if(!item.IsDBNull("PubDate")) {
<span>@item.GetDateTime("PubDate").ToString("MMMM dd, yyyy")</span>
}
</small>
</div>
@if(!item.IsDBNull("PrimaryImage")) {
<div class="primaryImg">
@if(item.GetFiles("PrimaryImage").Count > 0){
if(item.GetFiles("PrimaryImage")[0].ContentType.StartsWith("image/")) {
<figure class="figure figure-fullwidth">
<img src="@(item.GetFiles("PrimaryImage")[0].Url)?width=1070&height=300&mode=crop" class="img-fluid" />
</figure>
}
}
</div>
}
<div>@BRT.Raw(@item.GetString("Body"))</div>
<div>
@if(!item.IsDBNull("PrimaryContact")) {
<div class="box box-outline">
<h4>Contact Information</h4>
<h5>@item["PrimaryContact"]</h5>
@if(!item.IsDBNull("Location")) {
<p>@item["Location"]</p>
}
@if(!item.IsDBNull("Address1")) {
<p>
<span>@item["Address1"]</span>
@if(!item.IsDBNull("Address2")) {
<span>, @item["Address2"]</span>
}
</p>
}
@if(!item.IsDBNull("City")) {
<span>@item["City"]</span>
}
@if(!item.IsDBNull("State")) {
foreach(CategoryFieldItem cat in item.GetCategory("State")) {
<span>@cat.Label</span>
}
}
@if(!item.IsDBNull("Zip")) {
<span>@item["Zip"]</span>
}
@if(!item.IsDBNull("Phone")) {
<p>@item["Phone"]</p>
}
@if(!item.IsDBNull("Email")) {
<p><a href="mailto:@item["Email"]">@item["Email"]</a></p>
}
</div>
}
@if(!item.IsDBNull("Files") && item.GetFiles("Files").Count > 0) {
<div class="box box-outline">
<h4>Files</h4>
@foreach(FileFieldItem file in item.GetFiles("Files")) {
if(file.ContentType.StartsWith("image/")) {
<p><a href="@file.Url" target="_blank">@(String.IsNullOrEmpty(file.Title) ? file.Filename : file.Title) <i class="fas fa-file-image"></i></a></p>
} else {
<p><a href="@file.Url" target="_blank">@(String.IsNullOrEmpty(file.Title) ? file.Filename : file.Title) <i class="fas fa-external-link-square-alt"></i></a></p>
}
}
</div>
}
</div>
</article>)