Page 1 of 1

Categories in the Head

Posted: Sun Jun 22, 2008 3:14 pm
by rj
I am working on a project to use categories in the head of the blog to direct traffic to 5 different aspects of the blog.

All traffic comes in and sees a header with five logos they can click on to change the DB to one of five different areas of interest. When one is clicked a header for that category presents right below the main header, the DB goes to that category, and some of the sidebar stuff changes.

The way I am thinking now is to make an article sticky for each category that doesnt show on ALL CATEGORIES. But to make it look good, like a header, I have to somehow remove the title, date, and entry footer stuff from that first entry in each Parent category. Not sure how I can do that...

Need some help with that.
Or
A different way of doing what I am trying to do. :)

THANX

RJ

Posted: Mon Jun 23, 2008 4:45 pm
by Don Chambers
Not sure if this is what you want or not, but you could try the "properties/templates of categories" plugin. With it, each category can have a different template.... which can be the SAME template, but configured slightly differently if you wish (assuming it has template options). For a really custom look, you could take a single template, copy it into several different folders (each with a different name) and modify the template files as you need to.

Posted: Mon Jun 23, 2008 5:50 pm
by rj
I need to understand that first! :)
Gimmie a minute...

Posted: Mon Jun 23, 2008 6:03 pm
by rj
I think I asked about this a year or so ago.

That I miss having a plugin that would create some check boxes in the edit screen that said..
Remove title
Remove date
Remove article footer info

And then it could be used to place ads, present graphics, use as a sticky sub header or whatever one would like... It seems many of these event plugins do apply themselves to the edit screen.

Posted: Mon Jun 23, 2008 6:07 pm
by rj
I think I just figured out what you mean about using templates.
So I would take the template I have, tweak it some for each category, add it to a different css file and then load that css file when the category changed? Is that basic idea?

So the plug in is then the way of loading the different css files for the templates?
Thanx

RJ

Posted: Mon Jun 23, 2008 7:33 pm
by Don Chambers
I'm not trying to say this is the PERFECT solution, but here is what I had in mind:

Let's say you are currently using a template in the folder templates/mytemplate/. Let's assume that the info.txt file for that template lists the name of the template as "MyTemplate".

And let's assume you have 3 categories, and want the template to be slightly different than the "base" template when viewing entries for each of those categories.

First, I would copy the contents of /templates/mytemplate/ to /templates/mytemplate_cat1, /templates/mytemplate_cat2 and /templates/mytemplate_cat3. You now have 3 copies, one for each category.

Next, find the file /mytemplate_cat1/info.txt. Edit that file, and change the name of "MyTemplate" to MyTemplateCat1". Do the same for /mytemplate_cat2/info.txt and /mytemplate_cat3/info.txt, changing the name to MyTemplateCat2 and MyTemplateCat3 respectively.

Install the properties/templates of categories plugin. Make sure it is listed BEFORE the extended properties for entries plugin in the event queue if you use that plugin.

Next, edit category1. That page will now contain a few additional options for that category, among which is an option allowing you to select from a list of available templates. Select MyTemplateCat1 as the template you wish to use for catetory 1. Do the same for categories 2 & 3.

At this point, each category has its own unique copy of the template. You can modify your stylesheets for each category independent of each other. That also applies to files such as index.tpl and entries.tpl if you want whatever is generated by those respective files to be different depending on the category.

If you mark entries as belonging to more than a single category, return to the plugin configuration screen to set the precedence of each category so the plugin knows which template to use should an entry belong to more than one category.

Finally, the original base template /templates/mytemplate/ is still the template that applies to your frontpage and any other non-category specific page views.

Posted: Wed Jun 25, 2008 2:32 am
by rj
I see where you are coming from but... That is a whole new process when I have already found a way of doing all the steps EXCEPT for just removing the title, date and footer of one article. If only I could find a way to do that, I would not need to start all over with a whole new plan of attack. :)

I would think others would find such a event plugin very handy.
You could use if for placing ads, or just adding graphics or videos or jokes or things that dont need to be titled and footered and so on.

Posted: Wed Jun 25, 2008 3:15 pm
by judebert
I understand what you mean, but... you're using an entry, so it's going to have an entry footer. Your solution does most of what you want, not all.

To add data to pages, you could use the template blocks plugin, or maybe the "nugget in body" plugin. To hide the nugget in certain contexts, you'd need to combine template and CSS modifications, or use the sidebar hider plugin, or use the category templates plugin (with a slightly different custom template for each category, like Don said).

I can think of one reasonably simple solution, which would look beautiful. Make a header with a different bottom for each category. Install the category templates plugin. Define Bulletproof for each category, and define the category's header in the template options. (You can define a custom menu, too.) Now when you visit the category, you get a slightly-modified header. No template modifications required.

Here's another, but I'm not sure it'll work: add a <style> tag to your sticky entry to hide the footer. Examine your source to see what class (if any) applies only to the sticky entry.