Page 2 of 2

Posted: Wed Feb 27, 2008 1:48 pm
by garvinhicking
Hi!

Like

Code: Select all

{if count($category_info) > 0}
You are in category restriction mode
{else}
You are browsing this page without category restrictions.
{/if}
Regards,
Garvin

Posted: Wed Feb 27, 2008 3:05 pm
by yellowled
garvinhicking wrote:

Code: Select all

{if count($category_info) > 0}
You are in category restriction mode
{else}
You are browsing this page without category restrictions.
{/if}
I'm using the original Mimbo code for this.

category view: in category restriction mode

Start page, single entry, tag pages, static pages, contact form, archives page, entries summary: without category restrictions

Edit: I forgot: I added your code to index.tpl. Should I retry it with the code added to the various .tpl files used for the start page columns?

YL

Posted: Wed Feb 27, 2008 3:51 pm
by garvinhicking
Hi!

I didn't have a look at your *.tpl files at all yet, so I can't comment on where you actually need to put that. :(

Regards,
Garvin

Posted: Thu Jan 22, 2009 8:17 am
by suntsu
Hi there

Sorry for bumping this thread, but i've a question related to it.
If i select multiple categories via the categories plugin, it shows them correct with the url http://myblog/index.php?frontpage
But i would like to get an url like: http://myblog/index.php?serendipity[category]=1;2;3
The reason is that the users are able to create a bookmark to the categories they want.
Is there any way to do this?

thanks and cheers
manuel

Posted: Thu Jan 22, 2009 10:33 am
by garvinhicking
Hi!

For that, you can enable the "Smarty templating" option of the categories plugin, then edit your plugin_categories.tpl and change the POST method to GET; this should put everything into the URL bar to be able to bookmark that.

Regards,
Garvin

Posted: Thu Jan 22, 2009 1:06 pm
by suntsu
Hi

Thanks for your answer.
It indeed shows the categorys in the link, but after that, content of all categorys is shown, even if only some are selected:
http://myblog/index.php?serendipity[mul ... ltiCat]=Go!
In other words, the filter doesn't work anymore after changing to GET

cheers
manuel

Posted: Thu Jan 22, 2009 1:43 pm
by garvinhicking
Hi!

Hm, okay. Seems the serendipity code then checks on POST and not on GET.

Since usual FORM checkboxes only work as arrays and cannot append to a single variable, I think what you want to do is now possible this way.

You can do more tricky coding by writing smarty code that iterates the $categories arrays and create a link that users can bookmark; bookmarking the resulting page won't really work, as with all POSTed forms.

Another way would be to write a small event plugin that listens on the frontend_configure event hook, accepts the incoming GET data and autoconvert it to POST, so that s9y can operate on it.

Regards,
Garvin

Posted: Thu Jan 22, 2009 1:54 pm
by suntsu
Hi,

An URL like http://myblog/index.php?serendipity[category]=1;2;3 would work, i have to try whether i can edit the plugin_categories.tpl in a way that it returns the URL like that.
But i am not sure about to have success, since i'm not familiar with php.
But thanks anyway for your help.

cheers
manuel