How is the table, PagePaths, populated?

Permalink
I have been asked to maintain a site, so being VERY new to C5, I made a copy of the application on my server. However on my server the project is in a sub-directory so the links contained within the project are not correct.

To make things challenging, the Home page is a custom page (probably not the correct term) in that is is using Areas in the custom Theme. My guess is that there is some special way to access the links; the usual Edit feature in C5 does not work on the Home page.

I do see all of the links in the PagePaths table, but I am not sure how they get there.

Suggestions welcomed...

The copied project is at

http://www.toddcary.com/greaterbendrotary/...

Todd

rtcary
 
egnexas replied on at Permalink Reply
egnexas
It seems like the website has pretty urls enabled, but you don't have the .htaccess file. So either disable the option, or create the file.
mhawke replied on at Permalink Reply
mhawke
I would check to make sure you have an .htaccess file in the http://www.toddcary.com/greaterbendrotary/... directory. If you don't then just create a blank file called '.htaccess'.

Then go to

http://www.toddcary.com/greaterbendrotary/index.php?cID=60...


and turn off Pretty URLs and then turn them back on again.
mhawke replied on at Permalink Reply
mhawke
From what I see, the home page is using the same theme as the rest of the pages ('Rotary_Theme'). When you say the editing doesn't work, do you mean that there are no editable areas on the page when you put the page in edit mode?
rtcary replied on at Permalink Reply
rtcary
About the editing: Yes, there are no areas on the home page where the "Edit" is a choice. I poked around the files and found the Theme for the page and many Areas are used (implemented with php tags). The "Menu" at the top is a Stack (not sure how that is implemented with C5), not the type of menu I am used to that is done with HTML or JS.

Poking around in the DB I found the PagePaths table and it has the paths listed for the the menu items and they all are missing the "/greaterbendrotary" sub-directory.

For the site.php, I set the PATH to "/greaterbendrotary". Being so new to C5, I am at a great disadvantage since I cannot use my knowledge of HTML or PHP...for me it is getting an idea how the C5 works...especially since I am starting with a project not done by me.

Many thanks...

Todd
mhawke replied on at Permalink Reply
mhawke
I would advise you to stay out of the database. You should never have to change anything in there (unless you're fixing a very strange error) and it won't really help you acquire the knowledge you need to maintain a concrete5 site.

You should also reverse the changes you made in site.php.

Concrete5 knows where it is installed so the first thing you need to do is visit the 'Dashboard->System and Settings->Pretty URLs' and turn them off and back on again. This will reset things so they work in the new /greatbendrotary location.
rtcary replied on at Permalink Reply
rtcary
First and foremost, thank you for taking time to get me on track with C5!

Following your suggestions, here is what I have:

************
* site.php *
************
<?php
define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'mickey_mouse');
define('DB_PASSWORD', 'howdy');
define('DB_DATABASE', 'd_duck');
define('PASSWORD_SALT', 'xyz');
//define('BASE_URL', 'http://www.toddcary.com/');
//define('DIR_REL', '/greaterbendrotary');
?>

*************
* .htaccess *
*************
I deleted the one that got copied from the active project and turned Pretty URL's off and on. Here is the result:

# -- concrete5 urls start --
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /greaterbendrotary/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule . index.php [L]
</IfModule>
# -- concrete5 urls end --

Things have improved: the path is correct! However the requested page is not present. I assume that the pages are stored in the DB with the necessary parameters but are either not being created or are not being created in the correct location.

http://www.toddcary.com/greaterbendrotary/contact-us/...

http://www.toddcary.com/greaterbendrotary/...

Next step?

Todd
mhawke replied on at Permalink Reply
mhawke
That has created the proper info in the .htaccess file but clearly things are still not working. Have you turned off all the C5 caching and cleared the cache?
mhawke replied on at Permalink Best Answer Reply
mhawke
The pages are all still there if you add 'index.php' in the URL as shown below:

http://www.toddcary.com/greaterbendrotary/index.php/about-rotary/...

That's usually an indication that Pretty URL's need to be toggled. What happens if you just turn Pretty URLs off altogether and try to navigate the site?
rtcary replied on at Permalink Reply
rtcary
OK! That did it. What would be very helpful to me is a reference to an article that explains why that worked.

Knowing about that appears to make the moving of a project fairly straight forward, at least it was for me. I have a Centos Linux server in my home office, and I FTPed the project to my server (I was a little timid about compressing the files on the source machine since I did not want to risk doing something untoward) and copied the SQL DB file to my MySQL DB.

And many thanks for your assistance along with others.

Todd
mhawke replied on at Permalink Reply
mhawke
When you say 'That worked!' do you mean turning off Pretty URLs worked or did you modify all the paths to include 'index.php'

Also, I always compress/expand folders when moving sites. I find the FTP process for thousands of individual files to be far more fragile and the speed is 1000x faster when dealing with a single large file.
rtcary replied on at Permalink Reply
rtcary
I turned off Pretty URL's and everything is now accessible. In the past I had cycled the Pretty URL's On/Off/On.

http://www.toddcary.com/greaterbendrotary/...

However, I still do not know where the links are located for the menu; how those values get into the DB.
mhawke replied on at Permalink Reply
mhawke
Normally, sites use an AutoNav to handle the navigation. The AutoNav keeps track of Parent/Child relationships and displays only those pages that it is configured to display. That being said, I think your site is using navigation that has been created manually because the nav element has a class called 'ccm-manual-nav'. The nav links are probably 'hard-coded' into the page hence your inability to edit them. Without logging into your site, it's hard to say exactly how it's structured.
rtcary replied on at Permalink Reply
rtcary
Are there actual pages in Concrete5? Something I can examine? I can examine the Rotary Themes in the Themes directory, however I am not yet sure about how the Stacks structure has been implemented.

When I finally get my mind wrapped around this project, I am confident C5 will become my CMS of choice.

Todd
mhawke replied on at Permalink Reply
mhawke
Pages don't exist in the traditional way. They are 'collections' of stuff that make up a page. Think about it like this... The 'page types' in your theme directory are like arrangements of flower pots on your deck. For each page, you choose which arrangement you would like. After that, you put C5 in edit mode and plant different flowers in the empty pots.

When C5 renders the page, it first looks to see what page you want and then looks in the database to see what arrangement (i.e. page type) you want and then what flowers (i.e. your content) you planted in each pot (i.e. editable areas) for that page.

Does that make any sense whatsoever?
rtcary replied on at Permalink Reply
rtcary
Sorry about my ignorance, but could you explain more?

*** .htaccess ***
# Use PHP5 Single php.ini as default
AddHandler application/x-httpd-php5s .php

# -- concrete5 urls start --
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule . index.php [L]
</IfModule>
# -- concrete5 urls end --


Todd
mhawke replied on at Permalink Reply
mhawke
Did you turn Pretty URLs off and back on again?
egnexas replied on at Permalink Reply
egnexas
This looks like the old .htaccess file. I think in your case changing

RewriteBase /
to
RewriteBase /greaterbendrotary/

would work. Or what mhawke mentioned in his first post: turn them off/on.
mhawke replied on at Permalink Reply
mhawke
@egnexas... I know that /greaterbendrotary/ needs to be added to the .htaccess but I'm trying to move Todd away from doing things behind the scenes and asking him to work through the C5 front end. Directly editing the files can cause all kinds of problems later because random changes can be made to these files in an attempt to fix things. Later on, these changes confuse C5 and it's hard to decipher things here in the forums because we don't have access to his files.
rtcary replied on at Permalink Reply
rtcary
See my response above...followed your suggestions.

Todd