How to make index.php default to Home Page

7 posts by 3 authors in: Forums > CMS Builder
Last Post: October 23, 2008   (RSS)

By Laura - October 21, 2008

I have created a site in CMS Builder utilizing the category menu method. That being said for each page of the website, there is a corresponding menu item. All of the code is nested into my template which is index.php. I have a category named Home so that site visitors can click HOME on the menu and return to the home page as directed by Dave in a previous Forum post. My problem lies in how to make index.php point to the Home Page by default. In other words, I want those who visit the website to see the Home Category when they visit the page. Any Suggestions?

Re: [Laura] How to make index.php default to Home Page

By MisterJim - October 21, 2008

Laura,

When they visit your website now, by just typing in your URL without specifying a specific page, on which page do they land?

Also, if you don't mind giving it out, what is the site address?

Jim
WebCamp One, LLC



Websites That Work

Re: [Laura] How to make index.php default to Home Page

By Dave - October 21, 2008

Hi Laura,

Also, can you attach your index.php to the post so we can see the code? Thanks! :)
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] How to make index.php default to Home Page

By Laura - October 22, 2008

Thank you both for your quick replies.

Mr. Jim: As the site is being developed behind the current webiste until it is rolled out, when you type in the website it defaults to the current site.

Dave: I have attached the index.php file
Attachments:

index_005.php 3K

Re: [Laura] How to make index.php default to Home Page

By Dave - October 22, 2008

Laura,

Try this (changes in red):

$homeCategoryNum = 1;
$selectedCategoryNum = getNumberFromEndOfUrl();
if (!$selectedCategoryNum) { $selectedCategoryNum = $homeCategoryNum; }


list($categoryRecords, $selectedCategory) = getCategories(array(
'tableName' => 'update_website',
'selectedCategoryNum' => $selectedCategoryNum,
'categoryFormat' => 'onelevel', // showall, onelevel, twolevel
));


And just change $homeCategoryNum to whatever the number of your first category record is (click on it in the admin and look in the url to find that out).

Hope that helps! Let me know if that works for you.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] How to make index.php default to Home Page

By Laura - October 23, 2008

Dave, unfortunately it does not seem to work....

Any other ideas?