category templates

General questions pertaining to how certain issues can be resolved
Forum rules
1. No offensive language and no mocking
2. Please do a thorough search before you post something. Trust us, there is a high probability that the question you are asking has been asked previously.
3. No soliciting. You cannot post here soliciting bids for people offer you quotes, or even offer money to people for some work. You will be moderated if you do so. If you are looking for help, please post your request on http://jobs.wordpress.net or http://codepoet.com
4. Please be reasonable. You are getting software and support. For free. Complicated requests from a general purpose theme are not welcome and some volunteers might lose patience with you.
5. Please do your due diligence. If you posted a query and we answered with a link, take the trouble to go through the link contents.
6. Please post with complete information. Requests for help MUST be accompanied with your URL, particularly if you are asking something like "Why am I seeing a blank space?"

category templates

Postby Punk Wheat » 17 Apr 2012, 15:13

It looks to me that I will not be able to apply individual page templates to individual categories. Suffusion options/templates/single category: This template is automatically assigned to every category – you cannot manually assign it. I did go forward and copy the category php file, rename it with a category ID and stick it back in the theme, but I'm seeing no options. So, between that and the posts on the subject that I've read, it looks like the above statement applies to my dilemma.

If this is not possible, I think that would be a VERY GOOD thing to make possible in a future release. If it is possible, please somebody tell me what I'm missing.

With much appreciation for your outstanding work
puravidapost.com
Punk Wheat
 
Posts: 34
Joined: 10 Apr 2012, 16:52

Re: category templates

Postby sayontan » 17 Apr 2012, 15:26

Punk Wheat wrote: I did go forward and copy the category php file, rename it with a category ID and stick it back in the theme, but I'm seeing no options.

You are not going to see options based on this. Moreover, options are controlled via a bunch of files that I have provided with the theme and under no circumstances should users mess with them (well, you can mess with them, but you will dig yourself into a bottomless pit that way).

Basically when you copy the files and create your own templates, in the files you will see this code block:
Code: Select all
if ($suf_category_excerpt == 'list') {
   get_template_part('layouts/layout-list');
}
else if ($suf_category_excerpt == 'tiles') {
   suffusion_after_begin_content();
   get_template_part('layouts/layout-tiles');
}
else if ($suf_category_excerpt == 'mosaic') {
   //suffusion_after_begin_content();
   get_template_part('layouts/layout-mosaic');
}
else {
   suffusion_after_begin_content();
   get_template_part('layouts/layout-blog');
}


You can then delete the segments that you don't want. E.g. If your site is set up with a blog layout, and all your categories are set up with a tile layout, and for one particular category "x" you want a list layout, modify category-x.php by changing the above code to simply have this:
Code: Select all
   get_template_part('layouts/layout-list');


You don't need to have any of the conditions or other code blocks there.

The new Custom Post Type Archive that I have provided in 4.2.0 beta goes partly towards addressing this requirement. However at this point I haven't added query building functionality to it. E.g. If I have a custom post type called "book", I can use this template to create a tiled layout of all books, but I cannot create a tiled layout for one genre specifically. That should come up soon after 4.2.0 goes live, though.
Sayontan Sinha | http://mynethome.net/blog | http://www.aquoid.com/news
I don't do freelance work (for Suffusion or otherwise), so please don't contact me for quotes or offers.
sayontan
Site Admin
 
Posts: 10161
Joined: 15 Sep 2009, 16:39
Location: Houston, Texas

Re: category templates

Postby Punk Wheat » 17 Apr 2012, 16:02

Okay, well excuse me if I'm just being dumb here. What I'm wanting to do is apply different page templates to different categories, with the ability to customize a category in the same way I would do a page.Is "not really doable, especially if I am a caveman" the answer to that?
Punk Wheat
 
Posts: 34
Joined: 10 Apr 2012, 16:52

Re: category templates

Postby sayontan » 17 Apr 2012, 17:56

Very few things are truly "not doable". This is definitely not one of those. Since you had already made a copy of category.php, I gave you the way to do it with your approach. What I have suggested will work, but you would have to create a separate PHP file for each category that you wanted to make behave in a particular manner.

Beyond that, a GUI-based configuration of this is not available.
Sayontan Sinha | http://mynethome.net/blog | http://www.aquoid.com/news
I don't do freelance work (for Suffusion or otherwise), so please don't contact me for quotes or offers.
sayontan
Site Admin
 
Posts: 10161
Joined: 15 Sep 2009, 16:39
Location: Houston, Texas

Re: category templates

Postby Punk Wheat » 17 Apr 2012, 18:17

Thanks for the reply. That's something I'm going to have to do in order for my site to function the way I want it to. As I am a total noob and very much wading through things, I appreciate knowing that I'm not wading the wrong way. With everything that is already given to me here, creating seperate phps per category shouldn't be too much work. I'll look back at your instructions, and see if my mind can make sense of them so as to put them to proper use.

Thanks again. The fog is clearing.
Punk Wheat
 
Posts: 34
Joined: 10 Apr 2012, 16:52


Return to Support Requests

Who is online

Users browsing this forum: dkeqqwly, Google [Bot], KifyIrralay, reiseeronnorm, shenafyvek and 4 guests