Issue Displaying "Home" Page Text

7 posts by 2 authors in: Forums > CMS Builder
Last Post: March 22, 2010   (RSS)

By Laura - March 18, 2010

I have done this before, and know it is an issue with the URLs but just can't put my finger on how to resolve the issue. Please help!

I have created a website using the category type of Section Editors. The UI and Code Generator code are located within the index.php file on the webserver. I have copied the code in the attached index.txt file.

The first category within CMS Builder is called Home. It contains what the user should see when they click on the website. It can be seen at the following URL: http://www.jonescountyclerkofcourt.org/index.php?Home-1

The URLS are set up within CMSBuilder in the Section Editor List and Display Page URL field are: http://www.jonescountyclerkofcourt.org/index.php

I need when people click on http://www.jonescountyclerkofcourt.org/index.php they see the text that is displaying in http://www.jonescountyclerkofcourt.org/index.php?Home-1.

Where have I gone wrong?

Re: [Laura] Issue Displaying "Home" Page Text

By Chris - March 18, 2010

Hi Laura,

Try replacing this line:

'where' => whereRecordNumberInUrl(1),

with this:

'where' => whereRecordNumberInUrl("num = 1"),

The default (1) is supposed to select the first record in the section, so I'm confused why that's not working for you. If you post your full PHP source code I might be able to figure out what went wrong, but the fix above should solve the problem too.

I hope this helps! Please let me know if you have any questions.
All the best,
Chris

Re: [Laura] Issue Displaying "Home" Page Text

By Chris - March 19, 2010

Hi Laura,

A ha! You're using getCategories(), which I should have guessed from the indentation in your list. :)

Try changing this line:

'selectedCategoryNum' => '', // defaults to getNumberFromEndOfUrl()

...to this:

'selectedCategoryNum' => getLastNumberInUrl(1), // default to get num 1 if no num supplied on URL

I hope this helps! Please let me know if you have any questions.
All the best,
Chris

Re: [chris] Issue Displaying "Home" Page Text

By Laura - March 22, 2010

Thanks Chris for the quick response!

I changed the code and get the following error:
Fatal error: Call to undefined function getLastNumberInUrl() in /hermes/bosweb/web194/b1944/ipw.jonescounty/public_html/index.php on line 8.

Line 8 being the line replaced with the text above. Thoughts?

Re: [Laura] Issue Displaying "Home" Page Text

By Chris - March 22, 2010

Hi Laura,

Oops, getLastNumberInUrl() is the new name for that function, please use getNumberFromEndOfUrl() instead:

'selectedCategoryNum' => getNumberFromEndOfUrl(1), // default to get num 1 if no num supplied on URL

I hope this helps! Please let me know if you have any questions.
All the best,
Chris

Re: [chris] Issue Displaying "Home" Page Text

By Laura - March 22, 2010

Perfect! Thank you so much Chris!

As always, top notch customer support!