Page 1 of 2

Staticpage sidebar plugin help please

Posted: Wed Jun 25, 2008 7:36 pm
by carl_galloway
I'm using the staticpage plugin as my navbar by calling serendipity_showPlugin and it gives the impression of working, however I have two problems that I need to deal with.

The first is that the static pages sidebar plugin gives the full url of each static page, but what I want is for the static page with the set as frontpage option checked to not have it's full url. I'd prefer for the link to simply go to the URL homepage, eg www.domain.com. Is this possible? What needs to change inside serendipity_plugin_staticpage.php?

The second problem I've got is a mod_rewrite problem and I don't know if it's due to my Mamp, or if it's a serendipity problem. Basically the static pages urls have stopped working and all requests for a static page are being redirected to the main blog overview page. Does anyone know what might be causing the problem?

Re: Staticpage sidebar plugin help please

Posted: Thu Jun 26, 2008 9:23 am
by garvinhicking
Hi!

I don't really understand this problem, why do you need a full URL? That should never be required...and you'd really need to create your own PHP plugin (or patch the existing one) for this.
The second problem I've got is a mod_rewrite problem and I don't know if it's due to my Mamp, or if it's a serendipity problem. Basically the static pages urls have stopped working and all requests for a static page are being redirected to the main blog overview page. Does anyone know what might be causing the problem?
Are you sure mod_Rewrite is working on your Server? And how does your .htaccess look like?

Try to remove the "ErrorDocument ..." handler inside your .htaccess, this will reveal if mod_rewrite actually works. ErrorDocument serves as a fallback, which should usually also work. Also, try to create a blog entry and see if its permalink works?

Regards,
Garvin

Posted: Thu Jun 26, 2008 9:33 am
by carl_galloway
Hi Garvin,

Sorry about my explanation, I feel like I'm learning Serendipity all over again. I've had some memory problems and some things I just have to relearn.

I'll go and check the mod-rewrite thing, but for the first question, what happens is that I'm using the static pages sidebar plugin as my navbar and with some CSS changes it looks no different to any other navbar. Except that all of the URLs are full URLs as you'd expect, but I want the URL of the page which is configured to be the startpage to just have the normal homepage url so that in index.tpl I can test to see if the user is on the 'start' page and then give them a different look from non-start pages. Does that make sense? :) Sorry about this, I should know the answer, I think I've done something like this before but I can't find my original example.

Posted: Thu Jun 26, 2008 9:51 am
by garvinhicking
Hi!

Hm, okay. That would definitely require patching your plugin.

I just committed version 1.15 of the plugin which will set the URLs of staticpages marked as "frontpage" to the frontpage URL. Tell me if that works out for you. :)

HTH,
Garvin

Posted: Thu Jun 26, 2008 9:56 am
by carl_galloway
Wonderful, thanks Garvin, where can I download it?

Also, if I put two little flag icons in the theme, one for English, and one for Hungarian, what would be the URL to change the site language for each?

Posted: Thu Jun 26, 2008 10:39 am
by yellowled
carl_galloway wrote:Wonderful, thanks Garvin, where can I download it?
Jeez, you really haven't used s9y for some time, huh? :wink:

Either check it out of the additional plugins cvs on sourceforge.net or wait some days for the new version to be available on http://spartacus.s9y.org or via the Spartacus event plugin.

YL

Posted: Thu Jun 26, 2008 10:49 am
by garvinhicking
Hi!

As for the language - you can change it through http://url/?serendipity[lang_selected]=en

Regards,
Garvin

Posted: Thu Jun 26, 2008 11:44 am
by carl_galloway
Garvin, I've tried your suggestion and it isn't working. When I use the plugin drop down to select English or Hungarian it works prefectly, but when I put the exact same code as the link to a flaf button it doesn't work. Any ideas?

Posted: Thu Jun 26, 2008 11:45 am
by garvinhicking
Hi!

Would need to see it. Maybe a matter of GET vs. POST?

Regards,
Garvin

Posted: Thu Jun 26, 2008 11:48 am
by carl_galloway
So maybe I need to convert my flag image into a form instead of a link?

Posted: Thu Jun 26, 2008 1:00 pm
by garvinhicking
Hi!

Do you have the page online somewhere? It really should work if you use a <a href="http://index.php?serendipity[lang_selected]=XX">Lang</a>.

The only thing that might not work in this case is if you are logged in, then your preferences take precedence.

What does the Dropdown submit as URL variables? Maybe something else as lang_selected?

Regards,
Garvin

Posted: Thu Jun 26, 2008 1:09 pm
by carl_galloway
I logged out and it doesn't work, the html I'm using is this

Code: Select all

      <a href="index.php?serendipity[lang_selected]=en" class="first"><img src="{$serendipityHTTPPath}templates/{$template}/img/gb.png" height="20" width="20" alt=" " /></a>
      <a href="index.php?serendipity[lang_selected]=hu"><img src="{$serendipityHTTPPath}templates/{$template}/img/hu.png" height="20" width="20" alt=" " /></a> 

Posted: Thu Jun 26, 2008 2:26 pm
by garvinhicking
Hi!

Maybe lang_selected is not the right one, maybe you need to check the serendipity_event_multilingual.inc.php for all $serendipity['GET'] variables and see if any one of them looks like the right one. Don't have the time to do that right now.

Regards,
Garvin

Posted: Sat Jun 28, 2008 1:03 pm
by carl_galloway
Sorry to bump this, I know I've got this stuff working in the past but trying to find my previous threads here is like a needle in a haystack, anyway, I've tried both of user_language and lang_selected and neither of them is working.

If you have the time, are you able to take a look at the site again and see if you can get it to change language? http://tinyurl.com/58uh7p

Posted: Sat Jun 28, 2008 9:14 pm
by garvinhicking
Hi!

IT's ?serendipity[lang_display]=hu :)

Regards,
Garvin