Search found 22 matches

by jabeavers
Wed Dec 15, 2010 7:56 pm
Forum: General discussions
Topic: How can I get categories from within a template file
Replies: 6
Views: 3161

How can I get categories from within a template file

In my website I needed to get a list of s9y top-level categories to create links to them form my page to the blog. I used the following code to accomplish it. // Switch to the Serendipity path. We need to use chdir so that the s9y framework can use its relative calls. $oldDir = getcwd(); chdir('blog...
by jabeavers
Sat Oct 09, 2010 5:38 am
Forum: Themes
Topic: I want index page to list categories
Replies: 7
Views: 6853

Re: I want index page to list categories

Don't worry. I got it all working. I was able to list all the variables available to me by putting some {php} tags in my code and recursively printing the variables in "$this". Then I could see what I could use, and I put what I needed in content.tpl. I was also able to put some code in my...
by jabeavers
Fri Oct 08, 2010 6:10 pm
Forum: Themes
Topic: I want index page to list categories
Replies: 7
Views: 6853

Re: I want index page to list categories

Now, how do I tell if I am displaying entries in a category (like I click on a category link from my index page), or if I'm displaying an entry from that category? Also, how can I tell which category it is?

Thanks,
John
by jabeavers
Fri Oct 08, 2010 5:05 pm
Forum: Themes
Topic: I want index page to list categories
Replies: 7
Views: 6853

Re: I want index page to list categories

Ok, changed the $is_startpage to $startpage and it works.

Thanks.
John
by jabeavers
Fri Oct 08, 2010 5:01 pm
Forum: Themes
Topic: I want index page to list categories
Replies: 7
Views: 6853

Re: I want index page to list categories

Ok, I think I understand. Do you mean I need to have serendipity_categories_plugin installed? I do, however, I see no difference in my home page. It is still listing my entries. I played with the code, and it seems like it is only going to the else clause.

John
by jabeavers
Fri Oct 08, 2010 4:37 pm
Forum: Themes
Topic: I want index page to list categories
Replies: 7
Views: 6853

Re: I want index page to list categories

Thanks. What do you mean by "sidebar plugin"? Isn't the sidebar part of s9y and other plugins add content to it? How do I tell if it is installed, and where do I get it if it is not installed?

John
by jabeavers
Thu Oct 07, 2010 6:32 pm
Forum: Themes
Topic: I want index page to list categories
Replies: 7
Views: 6853

I want index page to list categories

I did not know whether to put this here or on the plugin forum. It seems more like a theme question. I want my index page to display a list of the categories of the blog instead of the entries. I have created a .tpl file called categories.tpl, but index.tpl just has {$CONTENT} and I don't know where...