About this topic

  • Posted by lee 2 years ago. There are 4 posts. The latest reply is from byron.
  • This topic is not resolved

Tags

  1. Hi Byron,

    Question on using Categories. I created a Custom Field that was configured as 'Category Drop Down - drop down of all WP categories'. I successfully, get a Category combo box on the photo upload with all of my Categories that I created in WP.

    What I am trying to do is have a link on each image in my custom layout that gives the name of the category that links to a gallery with all images that match the category. Similiar to what the [author_link] shortcode does in the Layouts Editor, but for categories.

    I see shortcodes in the Custom Form screen for [category_name], [category_link] and [category_id]; but it doesn't seem that they can be used in the Custom Layout.

    Any thoughts on how to add a link to each image for categories? I'm not using the WP upload features built into PS 0.4.01. Would using this help with categories?

    Thanks,

    Lee

  2. Lee,

    Truth is that the category support hasn't been built out in PS yet. I originally put it in for the custom work I did for some others. Those sites were using a custom implementation of the "create a new post" functionality coming in PS Extend, and I needed to get a category to assign to the newly created post, and that's why they're in the form right now.

    I've been trying to figure out what to do with them from the PhotoSmash side. Posts is easy, but when it comes to images and galleries, it's a bit trickier. I'm working on random galleries right now (hope to have it out the door in a few days), and I'm having to write special code for each Special Gallery (contributor galleries, random galleries, newest images, highest rated, by category, by tag, etc, etc).

    So, random galleries is coming up...the others need to follow on soon, but I also want to get PS Extend out the door, and that's going to be involved...arrrgggg.

    Anyway, right now, I think you should be able to use it in Custom Layouts by creating a link manually, something like: href='/?cat=[your-field-name]' Unfortunately, I don't give you any way to get the category name right now.

    Hope that helps.
    BB

  3. Hi Byron.

    The href='/?cat=[your-field-name]' works to get the category number. and the link works to bring up the default category page in WP. Working without the name for now is OK. I can create a document called 'category-4.php' and this page is successfully loaded with the actual WP category name at the top.

    I can get a PS gallery into the category page with no problem, however, I dont see a way to query by category so only images under that category are displayed. It still seems like that there is no property in the [Photosmash] shortcode that would allow me to only display images from a certain category. can you verify this? Is there a way to send a modified [photosmash] shortcode that would return only images from a certain category?

    Thanks,

    Lee

  4. You're correct...currently no way to query images by category. This will have to be a special gallery type (like a Contributor gallery is a special type) that will accept (or look for current category) and query the DB for images with a specific category.

    I'm trying to decide what to do about categories. WP 2.8 brings up the ability to do custom taxonomies, so that's an option. The other thing I'm considering is doing a table to store categories by image so you can multiple cats and query on that.

RSS feed for this topic