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: [chris] Issue Displaying "Home" Page Text

By Laura - March 19, 2010

Thank you Chris for your time. I had attached the code to the previous posting, but it seems like it didn't post. I have attached it to this post to assist you.

I don't have that line of code. Mine is set up using code provided in the forums to automatically generate an unordered listing menu by setting up your site using the Category Menu style in CMS Builder. This was necessary as my client wants the ability to automatically add items to the menu through CMS Builder but doesn't have the technical capability to code it themselves.

Does this help?
Attachments:

phpcode.txt 3K

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: [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!