• BrettEldridge
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 3
    Replies

We are a brand new, fast growing startup company in Brisbane. Our product and service is unique, and we are looking to attract a developer or two with a fantastic offer.

 

The developer must be located in Brisbane, as this is not just a programming job, but a planning and creating job also.

The developer must be able to put forward ideas and improvements.

 

This offer is not just a one off development, but more an ongoing project. Due to this, we are not just offering cash, but the option of shares.

 

Please let us know if you are interested.

 

I am very new to apex, coming from PHP.  

 

I am helping out a company that I think is being way overquoted for a website.  So, I am looking into Apex, and seeing if I can keep them honest.

 

I just want to know if I am on the right track.

 

We need a multi page website (40). There are 5 different headers and footers (Different Sections of the site). The content for almost every page it text and a couple of images.

 

So here is my approach.

 

Build 1 site.

Build the 5 headers and 5 footers as componants.

Build a visual force page for each page of the site and call upon the componants for the headers and footers.

Create a controller for each page (Example Below) to get the data from the cms object.

Within the controller, add a test class that checked out at 100% (Also Below).

Make sure the security settings allow the public to view the pages.

 

All I want to know, is if I am on the right track?  Would you do something differently?

 

Here is a sample of the controller to get the data. Once again, on the right track?

 

public class Web_Property_Home {

private final Website_Page__c field;
public Web_Property_Home() {
field = [select name,id,Main_Heading__c,Main_Text__c,Text_Field_1__c,Text_Field_2__c,
Text_Field_3__c,Sub_Heading_1__c,Sub_Heading_2__c,Sub_Heading_3__c,Image_1__c,Image_2__c from Website_Page__c where Name = 'Home Page' Limit 1];
}

public Website_Page__c getfield() {
return field;
}

static testMethod void Web_Property_Home(){
Website_Page__c objWeb = new Website_Page__c();
objWeb.Name = 'Home Page';
insert objWeb;
Web_Property_Home objClass = new Web_Property_Home ();
objClass.getfield();
system.assert(objClass.field != null);
}

}

 

 

Hello,

 

I am very new to Apex....    Been thrown in, and need to learn fast.

 

I have just started looking into test classes, and need some help.  I am designing a simple website that displays text from a record. Easy....   

 

My question is, how do you test something that doesn't really have anything to test?

 

Here is my class for the page:

 

public class Web_Property_Home {

 

private final Website_Page__c field;

public Web_Property_Home(){

field = [select name,id,Main_Heading__c,Main_Text__c  from Website_Page__c where Name = 'Home Page'];

 

public Website_Page__c getfield(){

return field; 

}


}

 

 

ANY Help would be appreciated.

Hi,

 

Very new here so sorry if my question is very obvious.

 

I am creating a website. Many pages, and the pages look different (Except for header and footer). But the Custom object I have created to store the text for each page is the same for all pages.

 

I have created 2 pages in visual force, very simple, they just display a field from the database depending on the page.

 

I have also created 2 controllers, they are identical, except for the database query, it says Where Name = 'X'   instead of Where Name = 'Y'

 

How can I use the same controller for these two pages?

 

I did get it to work by passing a name in the URL, eg..  /home?page=home

 

But why would I want the page on the URL twice?  Surly there is a way for the controller to read the first    /home   And then I can just use the page name to pull up a record. I will save each record in my cms object with name I used for the visualforce page.

 

I hope this makes sense, and hope it is possible.

 

Brett

 

Hello,

 

I am very new to Apex....    Been thrown in, and need to learn fast.

 

I have just started looking into test classes, and need some help.  I am designing a simple website that displays text from a record. Easy....   

 

My question is, how do you test something that doesn't really have anything to test?

 

Here is my class for the page:

 

public class Web_Property_Home {

 

private final Website_Page__c field;

public Web_Property_Home(){

field = [select name,id,Main_Heading__c,Main_Text__c  from Website_Page__c where Name = 'Home Page'];

 

public Website_Page__c getfield(){

return field; 

}


}

 

 

ANY Help would be appreciated.

Hi,

 

Very new here so sorry if my question is very obvious.

 

I am creating a website. Many pages, and the pages look different (Except for header and footer). But the Custom object I have created to store the text for each page is the same for all pages.

 

I have created 2 pages in visual force, very simple, they just display a field from the database depending on the page.

 

I have also created 2 controllers, they are identical, except for the database query, it says Where Name = 'X'   instead of Where Name = 'Y'

 

How can I use the same controller for these two pages?

 

I did get it to work by passing a name in the URL, eg..  /home?page=home

 

But why would I want the page on the URL twice?  Surly there is a way for the controller to read the first    /home   And then I can just use the page name to pull up a record. I will save each record in my cms object with name I used for the visualforce page.

 

I hope this makes sense, and hope it is possible.

 

Brett