Jump to content


Photo
- - - - -

Using a page as a category header!


This topic has been archived. This means that you cannot reply to this topic.
5 replies to this topic

#1 chocolaterebel

chocolaterebel

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 10 December 2010 - 10:40 PM

Oh dear, please forgive my ramblings on this post. I'm a designer, not much of a programmer, so if you can help out I'd be grateful!

I'm trying to either embed a category into a page, or a page into a category. Either will serve the purpose of having a page be a contextual, editable introduction to the content listed in that category. :)

Naturally, I'm running into some problems.


  • Plugins:
  • Please Login or Register to see this Hidden Content

    plugin
  • Please Login or Register to see this Hidden Content

    (discontinued by the author) and

    Please Login or Register to see this Hidden Content

    (a child plugin to Page2Cat)

    Please Login or Register to see this Hidden Content

    )
[/*]

I've embedded post-clips from my Audiobook category into my Audiobook page, which acts as a header/introduction to the list of posts. This isn't the only category/page combo that I'm embedding post-clips into; I also have a Podcast page with Podcast category post-clips embedded into it.

There are two plugins which would do what I'd like, but they each have their own drawbacks. To show the difference, I have each page using a different plugin.

The plugin

Please Login or Register to see this Hidden Content

does

Please Login or Register to see this Hidden Content

; a list, and applied very easily with bracket code in the page content. It requires no editing of template files. For what it does, it works well, however, there's no pagination nor a simple template system to format the output into magazine style post-clips, nor does it support the display of the audio player (see next plugin).

The plugin combo Page2Cat (sadly discontinued) and its child plugin Category Page Extender work together to

Please Login or Register to see this Hidden Content

, and it requires inserting code into template.postloop.php. Unfortunately, using this I've run into a bug where the output is duplicated.

Template code:

Please Login or Register to see this Hidden Content


As you can see from the Podcast page, the plugins work, kindof. The category posts are doubling for some reason. Normally I'd create a new page template, but I wasn't absolutely sure how to do this with PlatformPro, so I inserted the code into the template.postloop.php file, here:

Please Login or Register to see this Hidden Content


What I'd love to have happen is to see Pageline's magazine style post-clips be embeddable to pages with a category (or tag) filter. I can't do this perfectly with either plugin. I think it might be possible to format it this way with the List Category Post plugin with its template files, so I'll be plucking at it for a while until my little knowledge of php wears thin. ;)

A new feature idea? :) A text-content or page template section that can be defined to show specific categories or tags with the ability to attach features/boxes/highlights/or even pages in its content, as the current templates allow to do.

I'd love to be able to get this to work, please chip in if you have a clue how this can be made possible. :)

#2 chocolaterebel

chocolaterebel

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 11 December 2010 - 03:07 AM

I think I might have found another possible solution to my answer. Reading around I saw

Please Login or Register to see this Hidden Content

, about using Query-posts and Widget-logic plugings with the Content sidebar. Excellent stuff, I wouldn't have thought to look in that direction.

I have

Please Login or Register to see this Hidden Content

after following Sourena Parham's directions. I decided to go with embedding a page into the category since the inverse only produces a list. From here I will try to find a way to format it so that the page fits more naturally.

The only downside to this method is that I am not sure how to turn off the other sections (feature slider and full width sidebar) while I'm browsing the categories. Is there a way to create a new platformpro template that affects only category and tag browsing?

#3 catrina

catrina

    Advocate

  • Members
  • 12345 posts

Posted 11 December 2010 - 05:21 PM

Hm, there is no option for customizing the templates for categories and tags, but maybe there is a way to create new template files. Is this something that you're up for?

#4 chocolaterebel

chocolaterebel

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 11 December 2010 - 09:43 PM

Certainly, a new template section just for categories and tags would benefit everybody! :) Alternatively, if we follow Widget logic's train of thought), sections like the Feature Slider (et al.) could benefit from an excluding page/post/category/tag. Though that's far and away from a template solution, into the realms of core programming. :b

#5 chocolaterebel

chocolaterebel

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 24 December 2010 - 12:14 AM

Okay, with some effort I patched together a solution which I'll share here for everyone who ever wanted to put a category into a page. My coding's pretty messy, and I won't claim to know PHP, but it worked for me. :)

Plugin used:

Please Login or Register to see this Hidden Content

(modified)
Example:

Please Login or Register to see this Hidden Content

(using Pagelines Pro)

From here on I'll refer to List Category Posts as LCP since it's kind of a handful to type all the time.

LCP has 4 php files that direct the plugin:

lcp_widget_form.php
list_cat_posts.php
list_cat_posts_widget.php
templates/default.php

I only modified two files, list_cat_posts.php and default.php. default.php is an example of LCP's template system, see the plugin site for more information about this.

LCP had a couple of bugs that I had to sort through before I could make it work the way I wanted it to, and most of those fixes I found while browsing the support forum on wordpress. Feel free to improve upon the changes I've made. :)

the modified list_cat_posts.php file:

Please Login or Register to see this Hidden Content


the modified default.php file:

Please Login or Register to see this Hidden Content


Just a reminder, I'm not a programmer, so I won't be able to give any support in regards to things that don't work. If it does work for you, please let me know! :)

#6 chocolaterebel

chocolaterebel

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 24 December 2010 - 04:21 AM

Ah, sorry. Broke the page with the extra long code. :(

If you're having trouble copy-pasting, I've uploaded both files as txt.

Please Login or Register to see this Hidden Content



Please Login or Register to see this Hidden Content



I hope someone finds this useful! :D