Static Pages not linking

Having trouble installing serendipity?
peabee
Regular
Posts: 9
Joined: Fri Feb 23, 2007 6:26 pm

Static Pages not linking

Post by peabee »

Hi everyone,
I've installed the static pages plugin on my site and created a single entry to link to the "About" section but so far every link at the top of the page simply reloads to the main (start) page instead.

In the TPL file for the theme ("leaf" in this case) I verified the path to the HTML file that it should be linking to: index.php?/pages/about.html

I create the static page with the same page name, and published it (usign the static page interface in the administration section). Nothing. I tried updating the path in case it maybe wasn't reading it correctly. I tried an absolute path from the root of the webserver, a relative path, a web path, and no path (except for the "index.php?..."). Nothing. I checked the database via phpMyAdmin to ensure the entry was there (it was), checked permissions on all files and directories, cleared my browser cache, and reloaded. Nothing. I tried it in FireFox and IE on two different computers. Still nothing.

These pages are not absolutely necessary and I'll remove them if I can't get them up and running, but I'm willing to try any suggestions you may have. I'm an experienced PHP developer (I do Flash/PHP development for a living and am well-versed in object-oriented PHP) - so feel free to drop technical suggestions as well.

Many thanks for your time!

Patrick
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Static Pages not linking

Post by garvinhicking »

Hi!

So I understand you right that the staticpage itself does not show up, when you call "index.php?/pages/about.html", right?

Can you tell us which options/radiobuttons you set for that 'about' staticpage? Maybe if you chose a different language, or saved the article as "draft" it might not display on the frontpage. Best would be if you could supply a screenshot of how your static page admin section for that page looks like?

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
peabee
Regular
Posts: 9
Joined: Fri Feb 23, 2007 6:26 pm

Re: Static Pages not linking

Post by peabee »

garvinhicking wrote:Hi!

So I understand you right that the staticpage itself does not show up, when you call "index.php?/pages/about.html", right?
Exactly. It doesn't show up either as a link from the main page or when called directly. You can see the blog at http://www.peabee.com/blog
garvinhicking wrote:Can you tell us which options/radiobuttons you set for that 'about' staticpage? Maybe if you chose a different language, or saved the article as "draft" it might not display on the frontpage. Best would be if you could supply a screenshot of how your static page admin section for that page looks like?
Sure. Here's a screenshot of the settings (these have been saved like this): Image

I'm not putting in any special content until I can get this worked out so this is all I have for now. Do you see anything out of place? I can post screencaps of anything else you think may be incorrect.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Static Pages not linking

Post by garvinhicking »

Hi!

Okay. I can call up the staticpage using the "about" key you configured that's used as a "fallback" mechanism:

http://www.peabee.com/blog/index.php?se ... age]=about

This tells us at least your staticpage CAN be displayed and IS properly stored. The only thing we have to figure out is why the permalink itself does not work.

Can you check:

1. What exactly you entered in the permalink? I assume it's "/blog/index.php?/pages/about.html"?

2. In your s9y configuration, what did you set the "URL Rewriting" method to? If you set it something other than "None", try to use a permalink like "/blog/pages/about.html"

3. Can you check the serendipity_staticpages DB table and see if you have more than one DB entry for the ".../pages/about.html" entry?

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
peabee
Regular
Posts: 9
Joined: Fri Feb 23, 2007 6:26 pm

Re: Static Pages not linking

Post by peabee »

garvinhicking wrote:Hi!

Okay. I can call up the staticpage using the "about" key you configured that's used as a "fallback" mechanism:

http://www.peabee.com/blog/index.php?se ... age]=about

This tells us at least your staticpage CAN be displayed and IS properly stored. The only thing we have to figure out is why the permalink itself does not work.
Okay, good to know.
garvinhicking wrote: Can you check:

1. What exactly you entered in the permalink? I assume it's "/blog/index.php?/pages/about.html"?
It's exactly "/~patrickb/peabee/blog/index.php?/pages/about.html" which is the direct link from the root folder of my server.
garvinhicking wrote: 2. In your s9y configuration, what did you set the "URL Rewriting" method to? If you set it something other than "None", try to use a permalink like "/blog/pages/about.html"
URL rewriting is currently disabled.
garvinhicking wrote: 3. Can you check the serendipity_staticpages DB table and see if you have more than one DB entry for the ".../pages/about.html" entry?
From what I can see there's only one entry for this. I exported the table to the following PDF file http://www.peabee.com/images/entries.pdf

Thanks for your quick replies, BTW, much appreciated.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Static Pages not linking

Post by garvinhicking »

Hi!
It's exactly "/~patrickb/peabee/blog/index.php?/pages/about.html" which is the direct link from the root folder of my server.
There we have it! It should be "/blog/index.php?/pages/about.html" because you need to enter the full HTTP path there, not a filesystem path.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
peabee
Regular
Posts: 9
Joined: Fri Feb 23, 2007 6:26 pm

Re: Static Pages not linking

Post by peabee »

garvinhicking wrote:Hi!
It's exactly "/~patrickb/peabee/blog/index.php?/pages/about.html" which is the direct link from the root folder of my server.
There we have it! It should be "/blog/index.php?/pages/about.html" because you need to enter the full HTTP path there, not a filesystem path.
I tried that as well (as I mentioned in the first message), but I'll try that right now again just to verify.
Setting to : "/blog/index.php?/pages/about.html"...

... and no change. I also tried "http://peabee.com/blog/index.php?/pages/about.html". I verified in phpMyAdmin: the permalink column is now "/blog/index.php?/pages/about.html". Initially I had suspected that this was the problem as well but it seems to be having no effect.

What else do you think could be causing this?

P.S. I re-exported the table to this PDF file: http://www.peabee.com/images/entries2.pdf
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Static Pages not linking

Post by garvinhicking »

Hi!

That's pretty strange. Since you volunteered for some PHP debugging, let's have a stab at that. The most probable problem might be related to some other event plugin interfering - which ones do you have installed, in what order?

The permalink lookup is performed in the serendipity_event_staticpage.php file. Serendipity calls the plugin API hook 'genpage' before it displays the output.

The plugin checks that hook in the PHP file at around line 2143, where it reads "case 'genpage':...".

What the code does is to check the URI arguments, paste it into a $nice_url value, perform some check and pass the result into $serendipity['GET']['subpage']. Remember that variable? It's the one we already had access to your blog - so ideally, this variable will need to hold the permalink of your staticpage. This value is then compared in the database by calling the "$this->selected()" method.

So to debug that you could check the contents of those variables. there are other plugins that might set the variable, rendering the staticpage plugin unable to perform any more lookups. You usually can fix this by re-arranging the event plugins.

You might want to look into other plugins that you are using to see which one of them tries to get a hold of the 'subpage' variable and renders it useless...

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
peabee
Regular
Posts: 9
Joined: Fri Feb 23, 2007 6:26 pm

Re: Static Pages not linking

Post by peabee »

garvinhicking wrote:Hi!

That's pretty strange. Since you volunteered for some PHP debugging, let's have a stab at that. The most probable problem might be related to some other event plugin interfering - which ones do you have installed, in what order?
Okay, here they are in order:
1. [C] Markup: Serendipity
version: 1.3
2. [C] Markup: Emoticate
version: 1.4
3. [C] Markup: NL2BR
version: 1.7
4. Browser Compatibility
version: 1.1
5. [C] Spam Protector
version: 1.61
6. [C] Spartacus
version: 2.9
7. Spam Protector (SURBL)
version: 1.1
8. [C] Autosave entries
version: 0.2.2
9. [C] Tooltips
version: 1.4
10. [C] Links to next/previous entry
version: 1.32
11. [C] Fix common XHTML errors
version: 1.5
12. Livesearch
version: 1.4
13. [C] Typeset/Extended Buttons for non-WYSIWYG editors
version: 0.8
14. [C] User Profiles
version: 0.20
15. [C] Contact Form
version: 1.10
16. [C] Options for trustworthy editing on multi-user blogs
version: 0.2
17. [C] Announce entries
version: 1.07
18. [C] Statistics
version: 1.44
19. Post via XML-RPC
version: 1.26
20. [C] Static Pages
version: 3.41
21. [C] Extended properties for entries
version: 1.13

Static pages was among the first items installed and I couldn't get it working correctly from the start.
garvinhicking wrote: The permalink lookup is performed in the serendipity_event_staticpage.php file. Serendipity calls the plugin API hook 'genpage' before it displays the output.

The plugin checks that hook in the PHP file at around line 2143, where it reads "case 'genpage':...".

What the code does is to check the URI arguments, paste it into a $nice_url value, perform some check and pass the result into $serendipity['GET']['subpage']. Remember that variable? It's the one we already had access to your blog - so ideally, this variable will need to hold the permalink of your staticpage. This value is then compared in the database by calling the "$this->selected()" method.

So to debug that you could check the contents of those variables. there are other plugins that might set the variable, rendering the staticpage plugin unable to perform any more lookups. You usually can fix this by re-arranging the event plugins.
Okay, that sounds reasonable. I'll check out that section of code to see what's being stored. If it's not what's expected, I'll trace the calls back/forward a little to see if it's losing the value mid-stream (within the plugin). If this is not the case then I'll work on the assumption that another plugin is manipulating the values and try re-arranging them.
garvinhicking wrote: You might want to look into other plugins that you are using to see which one of them tries to get a hold of the 'subpage' variable and renders it useless...
:) We're thinking the same thing. Okay, I'll have a look and get back to you. Thanks again.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Static Pages not linking

Post by garvinhicking »

Hi!

The Contact Form is my quite safe bet. Try to move it AFTER the static page plugin in the order.

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
peabee
Regular
Posts: 9
Joined: Fri Feb 23, 2007 6:26 pm

Re: Static Pages not linking

Post by peabee »

One quick question: I'm not familiar with Serendipity behind the scenes but I'm assuming that "Event" plugins are actually trigerred via events, is that correct? If so, I should be able to hook up my own listener for event broadcasts as well, is that right?
peabee
Regular
Posts: 9
Joined: Fri Feb 23, 2007 6:26 pm

Re: Static Pages not linking

Post by peabee »

garvinhicking wrote:Hi!
The Contact Form is my quite safe bet. Try to move it AFTER the static page plugin in the order.
No luck. I put Static Pages quite high in the list and Contact Form right at the bottom. I also tried removing it (it's gone now) but with no effect.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Static Pages not linking

Post by garvinhicking »

Hi!

Dang, that's too bad, I really hoped the contact form would cause it. :(

So did you already have the chance to check what $serendipity['GET']['subpage'] is being set to in the staticpage plugin? You could emit those variables for debugging via a header() call and view them using firefox extensions like LivEHTTPHeaders. So you don't need to echo them to destroy the layout.

About the Event things: Yes, s9y has a event calling routine. You can build your own plugins that "listen" on that event and are executed if the event is fired.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
JACOBKELL
Regular
Posts: 31
Joined: Tue Sep 05, 2006 3:33 pm

Post by JACOBKELL »

One offtopic question:can be php code insterted into comment?With using include function?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi Jacobkell!

Please do not post such completely different questions into an existing thread. Make a new one, and I'll answer.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply