Classifieds v2.0.0

=== Classifieds ===

Requires at least: 3.0
Tested up to: 3.0.2
Stable tag: 2.0.0
Download location: https://premium.wpmudev.org/project/classifieds/download

== Description ==

Add Classifieds to your blog, network or BuddyPress site. Create and manage ads,
upload images, send emails, charge your users for placing ads on your network or BuddyPress site.

== Installation ==

1. Extract the plugin archive file.
2. Upload "classifieds" folder to the "/wp-content/plugins/" directory.
3. Activate the plugin through the 'Plugins' menu in WordPress

== Frequently Asked Questions ==

= Can Classifieds run side by side with CustomPress / Directory ? =

If you have CustomPress or Directory activated you will receive a fatal error since, there is a function with the same name in the packages. Deactivate CustomPress or Directory and everything will be fine. This will be fixed for the next version release.

== Changelog ==

= 2.0.0 =
* Front-end classifieds management added.
* Front-end classifieds management added for BuddyPress ( integrated with BP user profiles )
* Improved Admin UI.
* Internal code architecture entirely rewritten for version 2.0 all legacy code removed.
* Custom database tables eliminated. Replaced by core "wp" tables.
* Content Types submodule added.
* Localization available ( You need to generate a PO/MO file )

= 1.1.1 =
* Initial release.

== Upgrade Notice ==

= 2.0.0 =
Due to the fact that the internal architecture of the current version is completly
different from the previous one, the "v2.0.0" release is NOT backward compatible
with the "v1.1.1" release. All data gathered from previous installations of this plugin
will not be available to the "v2.0.0" release.

== Usage Guides ==

= Admin Content Types =

When you first load the Classifieds plugin, some Content Types data will be created, meaning you will have one custom post type named "classifieds", two taxonomies named "classifieds_tags" and "classifieds_categories" and two custom fields named "Duration" and "Cost". Each type comes with all the necessary settings.

You can extend the functionality of your post type "classifieds" by going to [Content Types]->[Post Types] and click on the post type title or on the [Edit] link below it. You will be able to extend your "classifieds" custom post type from there, ( you will find more information for each of the options on the Edit screen ).

You can add new taxonomy or edit the existing ones by going to [Content Types]->[Taxonomies]. You can click on the titles of "classifieds_tags" and "classifieds_categories" or on the [Edit] links below to edit the taxonomies ( you will find more information for each of the options on the Edit screen ).

You can add new custom field or edit the existing ones by going to [Content Types]->[Custom Fields]. You can click on the titles of "Duration" and "Cost" or on the [Edit] links below to edit the custom fields ( you will find more information for each of the options on the Edit screen ).

= Admin Settings =

- General -

When you first load the Classifieds plugin, there will be some initial data that you will have to provide to ensure proper operation of the plugin. Go to [Settings]->[General]->[Credits] and insert the required data ( you will find more information for each of the options on the options screen ).

You will also have to provide general information about the Checkout process. Go to [Settings]->[General]->[Checkout]. You will find an options screen where you can insert your business details. This information will be displayed under the front-end page [yourdomain.com][(if)blog-subdomain][checkout].

- Payments -

The current version integrates the PayPal Express payment gateway. You will have to set your API Credentials under [Settings]->[Payments]->[PayPal Express] ( you will find more information for each of the options on the options screen ) .

= Admin Credits =

Under [Credits] Classifieds admin menu you will find a log page where you can see your current credits balance and basic credits purchasing log. You will also find a button [Purchase] which will redirect you to the front checkout screen so you can buy credits or make a subscription.

= Admin Dashboard =

From the admin dashboard you will see all the available classifieds that you have. There is a [Create New Ad] button which will redirect you to the [Add New Classified] admin screen.

On the admin dashboard you will also find quick access to [Edit Ad]/[End/Renew Ad][Delete Ad] actions. And info about each ad e.g. "Expiration Date"

= Front End Classifieds Managment =

Under [yourdomain.com]/[classifieds]/[my-classifieds] you will find a front-end UI for managing your classifieds. You can view your available credits, you can [Edit Ad]/[End/Renew Ad][Delete Ad].

= Display =

Under [yourdomain.com]/[classifieds] you will find list of all classifieds published on the site. When you click on the author links you will get all classifieds from that author. When you click on a category/tax custom taxonomy term, you will see all classifieds with that term.

    gina

    tried to install and i got:

    Warning: include_once(classifieds/classifieds.php) [function.include-once]: failed to open stream: No such file or directory in /home/xxxx/public_html/xxxx.com/wp-content/mu-plugins/classifieds.php on line 42

    Warning: include_once() [function.include]: Failed opening 'classifieds/classifieds.php' for inclusion (include_path='.usr/lib/phpusr/local/lib/php') in /home/xxxx/public_html/xxxx.com/wp-content/mu-plugins/classifieds.php on line 42

    Ivan

    @gina Are you sure you are using the v2.0 version. I see you get an error when the setup tries to include "classifieds.php". There isn't such file in the v2.0 version. Also from your error path I see you have it in "mu-plugins". The v2.0 should be placed in the standard "plugins" directory.

    @drdave Go to the main Classifieds admin menu. Under it you will find the [Settings] link. When you click on it, there should be a sub page called [General] and a sub-sub page called [Credits]. You should see everything in a single screen.

    @Hiranthi Yes, currently, you can't run CustomPress, Directory or Classifieds side by side. This will be resolved in a subsequent release for each of the plugins. Simply deactivate Directory or CustomPress and you will be able to run Classifieds.

    leewillis77

    Not a bug, but a small feature request. Love the fact this now uses CPTs and taxonomies. It'd be even better if against the post types in Classifieds > Content Types > Post Types I could add existing taxonomies to the classifieds. I already have custom taxonomies for the rest of my site, and it'd make huge amounts of sense to classify the ads by the same taxonomies.

    Will experiment with manually assigning these and see what happens. But would be nice if it was built in

    Ivan

    @leewillis77

    Can't set taxonomy as non-public.

    Go to Admin > Classifieds > Content Types > Taxonomies

    Edit classifieds-tags

    Change "Public" to False and save settings

    The taxonomy stays as public.

    Thanks for that, probably a bug, I will look into it and will get back to you.

    Not a bug, but a small feature request. Love the fact this now uses CPTs and taxonomies. It'd be even better if against the post types in Classifieds > Content Types > Post Types I could add existing taxonomies to the classifieds. I already have custom taxonomies for the rest of my site, and it'd make huge amounts of sense to classify the ads by the same taxonomies.

    Will experiment with manually assigning these and see what happens. But would be nice if it was built in

    Yes, definitely, this is a must have feature, I will supply it with the next version release.

    leewillis77

    I already have custom taxonomies for the rest of my site, and it'd make huge amounts of sense to classify the ads by the same taxonomies.

    Just an addendum to this request / slight bug report. The plugin currently overrides the taxonomy archives for all custom taxonomies [Presumably on the assumption that since only "Classifieds" taxonomies can be used with taxonomy ads that's OK].

    Ie - If you expand this so that classified ads can be associated with existing taxonomies, then it would be preferable if the URL to view all classifieds associated with term X from taxonomy Y was different to the general archive for term X, taxonomy Y, e.g.

    /taxonomy/term/

    The standard WordPress archive for a given taxonomy. By default will only show "posts" associated with that taxonomy term. It's up to the user if they want to expand this to pull in classified ads tagged with the term.

    /classifieds/taxonomy/term/

    Classifieds view for the given taxonomy term. Will only show "classifieds" tagged with the term.

    Again this would be useful as I already have posts assigned to custom taxonomies, and once I install this plugin my archives stop working - they get rendered through a classifieds template.

    Make sense?

    evandowen

    Very excited to see the new release. So, I've installed the plugin and have a few questions:

    1.) I do not want to take payments nor issue credits so what should my settings be? The last version of the plugin enabled you to offer free classifieds.

    2.) I've currently setup categories and setup a test ad, however, the page http://mydomainname.com/my-classifieds/ is blank.

    3.) I replied to my test ad and when I received the email it only passes the "subject" and "message" fields. It does not pass on the email address nor name. If the user doesn't enter this data into the message field then there is no way to respond. I do have the SMTP plugin installed for quicker routing of emails so I'm not sure if this is affecting anything.

    4.) Tags are a bit foreign to the typical user so how can I turn off tag selection?

    5.) There are many features now missing from the last version in the update like Widgets for searching ads, latest ads etc. Any plans to bring these back?

    6.) I've moved the My-Classifieds navigation item under the BP menu. How can I remove the menu item that automatically show up?

    For my specific use this latest version is a step forward, but a step back as well. Hmmmmm, what to do, what to do.

    Thanks!
    E

    Ivan

    @leewillis77

    Just an addendum to this request / slight bug report. The plugin currently overrides the taxonomy archives for all custom taxonomies [Presumably on the assumption that since only "Classifieds" taxonomies can be used with taxonomy ads that's OK].

    Currently Classified uses the “taxonomy.php” template for listing posts filtered based on taxonomy. This template applies for all taxonomies so it hijacks your taxonomy archive. Very easy solution is to ( first get familiar with http://codex.wordpress.org/Template_Hierarchy ) specify custom template for each of your taxonomies you are using with Classified e.g. “taxonomy-classifieds_tags.php” and remove the general “taxonomy.php” template. You can further customize templates by tags if you want.

    Ie - If you expand this so that classified ads can be associated with existing taxonomies, then it would be preferable if the URL to view all classifieds associated with term X from taxonomy Y was different to the general archive for term X, taxonomy Y, e.g.
    /taxonomy/term/
    The standard WordPress archive for a given taxonomy. By default will only show "posts" associated with that taxonomy term. It's up to the user if they want to expand this to pull in classified ads tagged with the term.
    /classifieds/taxonomy/term/
    Classifieds view for the given taxonomy term. Will only show "classifieds" tagged with the term.
    Again this would be useful as I already have posts assigned to custom taxonomies, and once I install this plugin my archives stop working - they get rendered through a classifieds template.
    Make sense?

    As mentioned in my previous replay, the usage of available taxonomies will be introduced in the next release, as for displaying “posts” only from the “classifieds” ( or any other ) post type use standard WordPress Loop and the query_posts() function - http://codex.wordpress.org/Function_Reference/query_posts . Use something like that to filter post types, taxonomies etc.

    global $query_string;
    query_posts( $query_string . "&post_type=classifieds&post_status=publish");

    It would be nice to have a UI option to make all "front-end" classifieds require approval from the site admin before they were published (& get rid of the "Draft/Published" drop-down on the frontend).

    Yes, I will consider it for the next release, thanks.

    Ivan

    @evandowen

    1.) I do not want to take payments nor issue credits so what should my settings be? The last version of the plugin enabled you to offer free classifieds.

    Simple. Don't enter any API credentials into the Payment settings ( the Payment module is disabled if no API credentials are present by default ). Also you can delete the "Checkout" page that gets created for you ( Trash It Only ). When setting the Credits in the "Cost Per Credit" field enter "0".

    2.) I've currently setup categories and setup a test ad, however, the page http://mydomainname.com/my-classifieds/ is blank.

    From one of your questions below, I see you are using it on BuddyPress. Sorry for the lack of details for BuddyPress. Classifieds for BuddyPress works slightly different. It uses the default BuddyPress profiles for the Classifieds and not a dedicated page like on a standard install. So your Classifieds page on BuddyPress is located at [yourdomain.com]/[members]/[member-name]/[classifieds]. You should see it in your BuddyPress user profile menu.

    3.) I replied to my test ad and when I received the email it only passes the "subject" and "message" fields. It does not pass on the email address nor name. If the user doesn't enter this data into the message field then there is no way to respond. I do have the SMTP plugin installed for quicker routing of emails so I'm not sure if this is affecting anything.

    Can you please test the message and report back whether all the fields pass values correctly and if you can post a sample Header of the message ?

    4.) Tags are a bit foreign to the typical user so how can I turn off tag selection?

    These are taxonomies, you can name them however you like. Categories and Tags are just names. Go to [Content Types]->[Taxonomies] and edit the taxonomies to reflect your way of organizing content.

    5.) There are many features now missing from the last version in the update like Widgets for searching ads, latest ads etc. Any plans to bring these back?

    Since the new Classifieds uses "post types", "taxonomies" and "custom fields" you don't actually need widgets since all things are interlinked in the ads. Each term shows all Classifieds with that term, each author link shows all Classifieds from that author, the Classifieds page shows all the latest Classifieds and you can use the default WordPress search to search Classifieds as they are a regular post type just like the standard posts.

    6.) I've moved the My-Classifieds navigation item under the BP menu. How can I remove the menu item that automatically show up?

    You want to remove the "My Classifieds" sub-page ( the blank one ) ?

    For my specific use this latest version is a step forward, but a step back as well. Hmmmmm, what to do, what to do.

    Its a big step forward but you need some time to grasp all the new concepts and begin applying them.

    Ivan

    @kevbow

    I have installed the plugin. When I upload a picture it doesn't appear in the ad and for some reason once I installed the plugin the drop down menu for members doesn't work anymore. wordpress 3.0.3 and buddypress 1.2.6

    @evandowen

    I found a bug....

    This version of Classifieds breaks the drop down menus in the bp admin bar at the top in the scholar theme.

    Thanks, I will look into it right away.

    evandowen

    Thanks for all the help Ivan! Here are some follow up questions and comments. Also, in case I didn't mention I'm using BP-Scholar Theme. BP 1.2.6 and WP 3.03

    Also you can delete the "Checkout" page that gets created for you ( Trash It Only ). When setting the Credits in the "Cost Per Credit" field enter "0".

    I entered "0" for the cost per credit field only and the "Checkout" page does not disappear. I have altered main-navigation.php using the BP-Scholar Child Theme. Not sure if that might have an effect.

    From one of your questions below, I see you are using it on BuddyPress. Sorry for the lack of details for BuddyPress. Classifieds for BuddyPress works slightly different. It uses the default BuddyPress profiles for the Classifieds and not a dedicated page like on a standard install. So your Classifieds page on BuddyPress is located at [yourdomain.com]/[members]/[member-name]/[classifieds]. You should see it in your BuddyPress user profile menu.

    If I'm reading this correctly then there isn't a central place/page where all classifieds show up? For me, this is an example of taking a step back. If there are, for example, 5 sofas for sale in the furniture category why would a user want to browse five different profiles to see these five sofas. The very nature of providing Classifieds on a website requires that related or similar items/products/services can be found in a central place.

    These are taxonomies, you can name them however you like. Categories and Tags are just names. Go to [Content Types]->[Taxonomies] and edit the taxonomies to reflect your way of organizing content.

    The only taxonomies I need are categories. I tried to delete tags and it wouldn't let me. Classifieds are the very basic of ad placements for primarily selling used items. In my opinion, this plugin should provide Craigslist simplicity for the most basic setup. The additional functionality is nice for those who want to expand upon it though.

    Can you please test the message and report back whether all the fields pass values correctly and if you can post a sample Header of the message ?

    Emails for classified inquiries do not seem to be working at all now. I was going to send screenshots of the form field and the associated email.

    ...the Classifieds page shows all the latest Classifieds and you can use the default WordPress search to search Classifieds as they are a regular post type just like the standard posts.

    What is the URL structure of this Classifieds page? I'm using BuddyPress as notated above. I just want to confirm if this page exists for me or not as your responses are conflicting.

    You want to remove the "My Classifieds" sub-page ( the blank one ) ?

    I got that one fixed, still can't get rid of the Checkout link though...

    Its a big step forward but you need some time to grasp all the new concepts and begin applying them.

    I hope so! The only thing that's missing is a page that shows the list of categories and all ads in those classifieds. It wouldn't hurt to have "create new ad" link on this page as well so the user doesn't have to navigate back to their profile to post something.

    I've uploaded a screenshot of another bug. I setup a test ad and another user created a test ad as well. When I navigate to my ad the picture associated with the other users ad shows up in the description. I also see my classified ad on every profile classified page we've setup on the site which doesn't sound right.

    Ivan

    @evandowen

    I entered "0" for the cost per credit field only and the "Checkout" page does not disappear. I have altered main-navigation.php using the BP-Scholar Child Theme. Not sure if that might have an effect.

    The "Cost Per Credit" option apply when users want to renew their ads. If the value is set to "0" users can renew all their ads since there is no cost associated with that action, as for the "Checkout" page, go to your [Pages] menu and trash it if you don't want to appear in the main navigation.

    If I'm reading this correctly then there isn't a central place/page where all classifieds show up? For me, this is an example of taking a step back. If there are, for example, 5 sofas for sale in the furniture category why would a user want to browse five different profiles to see these five sofas. The very nature of providing Classifieds on a website requires that related or similar items/products/services can be found in a central place.

    Not correct. You have a central page called [Classifieds] which is located under [yourdomain.com]/[classifieds]. This page displays all Classifieds on your site. Don't mistake this page with the My Classifieds page they are totally different.

    The only taxonomies I need are categories. I tried to delete tags and it wouldn't let me. Classifieds are the very basic of ad placements for primarily selling used items. In my opinion, this plugin should provide Craigslist simplicity for the most basic setup. The additional functionality is nice for those who want to expand upon it though.

    You can manage all of your taxonomies inside the [Content Types] plugin menu. Go to [Taxonomies] sub menu and delete the taxonomy that you don't want.

    What is the URL structure of this Classifieds page? I'm using BuddyPress as notated above. I just want to confirm if this page exists for me or not as your responses are conflicting.

    URL for the main [Classifieds] page: [yourdomain.com]/[classifieds] ( if you are using it on MS you should put [blog] or the user slug in between ). The page should be available in your main navigation.

    I hope so! The only thing that's missing is a page that shows the list of categories and all ads in those classifieds. It wouldn't hurt to have "create new ad" link on this page as well so the user doesn't have to navigate back to their profile to post something.

    I've uploaded a screenshot of another bug. I setup a test ad and another user created a test ad as well. When I navigate to my ad the picture associated with the other users ad shows up in the description. I also see my classified ad on every profile classified page we've setup on the site which doesn't sound right.

    Very strange, can you provde me with tmp admin access so I can look around to see what is causing this. Use the contact form to send me the access details with subject: Forward to Ivan

    I mispoke about the email not working. I was having an issue with my email locally. OK, so attached are screenshots of the form used to contact someone about their ad and the resulting email.

    I will check that, thanks for the screenshots.

    evandowen

    Again, thanks for your help Ivan. I'm making some progress.

    Not correct. You have a central page called [Classifieds] which is located under [yourdomain.com]/[classifieds]. This page displays all Classifieds on your site. Don't mistake this page with the My Classifieds page they are totally different.

    yourdomain.com/classifieds is blank on my site. I'm running MS so yourdomain.com/blog/classifieds comes up, however it looks like a broken member page.

    You can manage all of your taxonomies inside the [Content Types] plugin menu. Go to [Taxonomies] sub menu and delete the taxonomy that you don't want.

    I've tried multiple times to delete tags, however, it isn't deleting.

    Very strange, can you provde me with tmp admin access so I can look around to see what is causing this. Use the contact form to send me the access details with subject: Forward to Ivan

    Setting up now and sending your way.

    leewillis77

    Currently Classified uses the “taxonomy.php” template for listing posts filtered based on taxonomy. This template applies for all taxonomies so it hijacks your taxonomy archive. Very easy solution is to ( first get familiar with http://codex.wordpress.org/Template_Hierarchy ) specify custom template for each of your taxonomies you are using with Classified e.g. “taxonomy-classifieds_tags.php” and remove the general “taxonomy.php” template. You can further customize templates by tags if you want.

    You're right - I don't want Classifieds to hijack my category archive. I know I can override that, but I also still want to be able display a list of classifieds tagged with a specific term. If I do what you're suggesting - I'll no longer have a way of displaying all "classifieds" tagged Y for taxonomy X separately from the ability to display a traditional taxonomy term archive which may or may not include classifieds along side other posts.

    My preferred solution would be for the plugin to use the permalink structure:

    /classifieds/taxonomy/term/
    rather than
    /taxonomy/term/

    As mentioned in my previous replay, the usage of available taxonomies will be introduced in the next release, as for displaying “posts” only from the “classifieds” ( or any other ) post type use standard WordPress Loop and the query_posts() function - http://codex.wordpress.org/Function_Reference/query_posts . Use something like that to filter post types, taxonomies etc.

    And as I mentioned in my previous post you can do this now just by registering the taxonomy for the post type. The problem is that Classifieds has hijacked the URL that I would like to use for it - my existing taxonomy archives (Which are already a part of my site).

    So, as a real example, I want to publish classifieds on this site:

    http://www.getyourhandsback.co.uk/
    This already has a "brand directory" - http://www.getyourhandsback.co.uk/brand-directory/
    It also has taxonomy term archives - http://www.getyourhandsback.co.uk/brands/snugbaby/

    What I want to do is to install Classifieds, attach Classifieds to the "brands" taxonomy. Modify my existing taxonomy.php (Actually it's archive.php) to pick up say the most recent 3 classifieds for that term, and display them alongside the posts on the existing term archive URL, e.g. http://www.getyourhandsback.co.uk/brands/snugbaby/

    But I then also want to be able to view all classifieds for a particular brand. Currently there's no way to do that, because classifieds expects to be able to use the standard archive URL - I'd prefer it to use /classifieds/brands/snugbaby/

    Make more sense?

    evandowen

    I've uploaded a screenshot of another bug. I setup a test ad and another user created a test ad as well. When I navigate to my ad the picture associated with the other users ad shows up in the description. I also see my classified ad on every profile classified page we've setup on the site which doesn't sound right.

    OK, my bad on this one. I didn't realize that one of my cohorts was testing the back end admin to see if HTML worked in the description field and loaded an image in the ad. This is NOT a bug! Sorry!

    Ivan

    @geoclicks

    Hi, is it possible now, or will it be in the future to mark some categories as premium and accept payments and some as free?

    You can make a custom loop ( taxonomy-[taxonomy]-[term].php is the default template ) with the taxonomies you want to mark as premium and put your exclusion scripts there. You can test for a user capability, user role or some DB setting which acts as a flag for whether the user is premium or not.

    Ivan

    @leewillis77

    You're right - I don't want Classifieds to hijack my category archive. I know I can override that, but I also still want to be able display a list of classifieds tagged with a specific term. If I do what you're suggesting - I'll no longer have a way of displaying all "classifieds" tagged Y for taxonomy X separately from the ability to display a traditional taxonomy term archive which may or may not include classifieds along side other posts.

    The proposed solution does exactly that. You can make a template which will be used only for specific taxonomies and everything else will default either to your taxonomy.php template or to the archive.php template.

    My preferred solution would be for the plugin to use the permalink structure:

    /classifieds/taxonomy/term/
    rather than
    /taxonomy/term/

    Post Types and Taxonomies are perpended with different slugs which you can set inside the Content Types module for each of your post types or taxonomies. What you are suggesting here mixes the two content types. If you want to achieve some kind of hierarchy for your slugs you should do it on taxonomy level alone since this is the content type intended for content organization.

    And as I mentioned in my previous post you can do this now just by registering the taxonomy for the post type. The problem is that Classifieds has hijacked the URL that I would like to use for it - my existing taxonomy archives (Which are already a part of my site).

    So, as a real example, I want to publish classifieds on this site:

    http://www.getyourhandsback.co.uk/
    This already has a "brand directory" - http://www.getyourhandsback.co.uk/brand-directory/
    It also has taxonomy term archives - http://www.getyourhandsback.co.uk/brands/snugbaby/

    What I want to do is to install Classifieds, attach Classifieds to the "brands" taxonomy. Modify my existing taxonomy.php (Actually it's archive.php) to pick up say the most recent 3 classifieds for that term, and display them alongside the posts on the existing term archive URL, e.g. http://www.getyourhandsback.co.uk/brands/snugbaby/

    But I then also want to be able to view all classifieds for a particular brand. Currently there's no way to do that, because classifieds expects to be able to use the standard archive URL - I'd prefer it to use /classifieds/brands/snugbaby/

    Make more sense?

    Open the directory "classifieds/ui-front/general" or "classifieds/ui-front/buddypress" for WordPress or WordPress with BuddyPress respectively and copy the files from there which you want to extend or modify into your active theme. The files follow the WordPress template hierarchy convention http://codex.wordpress.org/images/1/18/Template_Hierarchy.png. If the files are present in your active theme directory they will be preferred over the ones found in the plugin directory. You can extend each one of them however you like following the Template hierarchy convention. Use custom Loop inside the files to display anything you like.

    If you have taxonomies which are not created with the Content Types module and you want to register them for the "classifieds" post type use the register_taxonomy() function - http://codex.wordpress.org/Function_Reference/register_taxonomy

    edihtors

    While I appreciate your last post and explanation Ivan, I find the whole concept of of hijacking permlinks, and multi-taxonomy post type custom loopty-loop hierarchy convention override content muck-a-muck to be just a tad bit convoluted.

    I've always been a big fan of WPMU, and will of course keep subscribing as I find a lot of things you guys release to be useful.

    Your last few major plugins though, including this, the directory, and even marketplace, have been taking a sharp right hand turn toward "hack job", and I can't possibly see them actually being used in a real way on a large scale site, like so many of your other products can.

    I really wish you'd get away from these new development trends, and just give us some shortcodes to dump on some pages that we can style as we wish and name as we want, and be done with it.

    Just my 2cents, but keep up the good work =)

    Ivan

    Hello edihtors,

    I don't agree with that "hack job" thing and I feel obligated to give a detailed explanation of what [shortcodes] are where you should use them and their limitations also how the “Template Hierarchy” works generally and within the context of the Classifieds plugin.

    A lot of plugins provide [shortcodes] which are wrappers for some kind of functionality. You can put them inside your posts body, widgets and other designated areas. Most [shortcode] events fire after the rendering of the front-end templates ( after the “template_redirect” hook ) which limits your ability to control the entire output of your templates. Shortcodes are best used when you have content which is loosely coupled with the rest of your templates and which you can include as a self contained unit.

    The Classified plugin aims to provide you with the ability to create highly customized user experiences in which you can control the front-end output of your templates in full.

    Lets say you want to have a custom “About” page which is different from the rest of your site. If you use [shortcodes] you will be able to customize only the page body since the [shortcode] fires when it reaches the_content() function. You can take a different approach, you can use the “Page Attributes” box inside the Add/Edit Page screen and create a custom template for your page. You will have to put the meta header in the template file and then you have to assign this template to the page. Now the picture is slightly different. You have control over the entire template output. You can rearrange items however you like, exclude some, include others, you can even create a custom Loop and display whatever you like. But wait, there is another way, using the “Template Hierarchy”. The only thing you have to do is copy your “page.php” template ( you can create entirely custom template if you like ) and rename it “about.php” or “page-about.php” or “page-2.php” ( assuming the ID is 2 ) and you get a custom page template which you can customize however you like.

    Same thing applies for Post Types, Taxonomies, Terms, Authors etc. Speaking in the context of the Classifieds plugin this means using the “Template Hierarchy” convention you can create a custom post type template for your “classifieds” post type extending the “single.php” template. The custom template for the “classifieds” post type will be “single-classifieds.php”. If you have a custom post type “example” the template will be “single-example.php” etc. The file “single-classifieds.php” is provided for you in the “classifieds/ui-front/general” or “classifieds/ui-front/buddypress” ( if you are using BuddyPress ). If this file exists in your active theme directory it will be loaded from there. So you can copy it from the plugin dir, past it in your theme and customize it however you like ( or you can create your own ). Same thing applies for Taxonomies, you can create templates for each of your taxonomies, for example if you have a taxonomy called “example” the template for that taxonomy will be “taxonomy-example.php”, let say you have a specific term in that taxonomy called “eterm”, you can create a template for your term ( which will apply only for this particular term ) called “taxonomy-example-eterm.php”, the possibilities for customization here are endless and the best part is that you are using standard WordPress Loop and all the familiar functions from templates such as “single.php” or “page.php”. With the ability to add unlimited number of custom fields to each of your templates I think you should begin to understand how powerful this thing really is.

    In conclusion I suggest to anyone who is interested in using the capabilities of Classifieds in full to check the following texts and learn them well:
    http://codex.wordpress.org/Template_Hierarchy
    http://codex.wordpress.org/The_Loop
    http://codex.wordpress.org/Function_Reference/query_posts

    leewillis77

    Ivan,

    Thanks for replying. I'll split up my comments into single posts so that they're easier to address.

    Bug :- Currently, the classifieds plugin BREAKS taxonomy archives.

    So, if I take the site I mentioned earlier. It has fully-functioning taxonomy archives - e.g.

    http://www.getyourhandsback.co.uk/brands/snugbaby/

    This is based on the archive.php template file (as per the WP hierarchy). If I install Classifieds then that page *breaks* because archive.php is no longer used - instead the template file supplied by the classifieds plugin is used. This is a bug because that taxonomy isn't even anything to do with classifieds.

    Proposed fix: Only re-direct the template if the taxonomy is valid for the classifieds post type.

    leewillis77

    Feature Request: Ability to display classifieds ads through a dedicated URL structure rather than through the default taxonomy archive.

    Background: My current taxonomy archive displays:
    - An image for that taxonomy term
    - Some descriptive text for the taxonomy term
    - The latest post in the "Review" category for this taxonomy term
    - A list of the latest posts tagged with this taxonomy term

    That needs to keep on working as-is - however I'd like to mix-in say the latest 3 classified ads tagged with that taxonomy term. So - I've registered my existing taxonomies against the "classifieds" post_type, and created ads tagged accordingly. With a bit of code in my archive.php file to control the display for these post types I'm all sorted.

    What I'd like to do is to drive people through into the classifieds "section" of the site with a "View more ads for Brand XXXX" type link - which would show all classifieds of this tag. However there's no way to do this currently as the only way of displaying classifieds for a tag is via the taxonomy archive, and I'm already using that for something else (See above)

    Ideally I want to be able to have the out-of-the-box taxonomy archive for a classifieds category *as well as* my existing taxonomy archive.

    I suspect I can work around this by adding a query_var to the links I generate, and those in single-classifieds.php and then adding logic in my archive.php to pick this up and switch display styles - but it seems a bit messy - any better approaches?

    Ivan

    @leewillis77

    Bug :- Currently, the classifieds plugin BREAKS taxonomy archives.

    So, if I take the site I mentioned earlier. It has fully-functioning taxonomy archives - e.g.

    http://www.getyourhandsback.co.uk/brands/snugbaby/

    This is based on the archive.php template file (as per the WP hierarchy). If I install Classifieds then that page *breaks* because archive.php is no longer used - instead the template file supplied by the classifieds plugin is used. This is a bug because that taxonomy isn't even anything to do with classifieds.

    Proposed fix: Only re-direct the template if the taxonomy is valid for the classifieds post type.

    This is not a bug at all, just Template Hierarchy in action. "archive.php" is the default fall back template for 6 different types so you should not use it if you want greater control over your templates. For your built-in WordPress taxonomies you should use the "category.php" and/or "tag.php" templates. Simply copy the code from "archive.php" into "category.php" and/or "tag.php" and remove "archive.php". You can also remove the general "taxonomy.php" template and replace it with fine-tuned templates for each of your taxonomies. One more time I will refer you to the Template Hierarchy article since I don't feel you have a good grip on the matters - http://codex.wordpress.org/Template_Hierarchy

    leewillis77

    This is not a bug at all, just Template Hierarchy in action. "archive.php" is the default fall back template for 6 different types so you should not use it if you want greater control over your templates.

    Hi Ivan, I'm afraid I disagree. This is a bug. The defined behaviour of the template hierarchy (Please believe me - I understand it perfectly well) is that archive.php is used if nothing more specific is defined by the theme. This works fine on a stock WordPress install, but stops working once Classifieds is installed.

    For your built-in WordPress taxonomies you should use the "category.php" and/or "tag.php" templates.

    My site doesn't use any of the built-in taxonomies - all of the taxonomies are custom taxonomies, so this is largely a moot point. However I will point out that there's no need to have separate category.php and tag.php files unless you want to display them differently - it is perfectly allowable to have them both rendered by archive.php. That's the behaviour that the template hierarchy defines - precisely so you can limit code duplication.

    Simply copy the code from "archive.php" into "category.php" and/or "tag.php" and remove "archive.php".

    That's exactly what you shouldn't do - as I said above using archive.php is sensible and practical if you want all of your archives to be rendered the same. Creating multiple copies of the same file for no good reason is a bad idea ...

    You can also remove the general "taxonomy.php" template and replace it with fine-tuned templates for each of your taxonomies.

    I don't have a taxonomy.php file - largely because I don't need one. My taxonomy archives are rendered perfectly adequately through archive.php as per the template hierarchy you keep linking to That is - until Classifieds is installed.

    The bug is that the classifieds plugin breaks the standard Template Hierarchy behaviour - by no longer falling back to archive.php for taxonomy archives (The code at fault is get_taxonomy_template() in core/core.php).

    I *know* why you're doing it (See http://www.leewillis.co.uk/wordpress-custom-post-type-theming-is-broken/ and http://darylkoop.com/2010/04/06/modular-themes-why/) - but it's broken and while you probably do still need to do something similar - you absolutely shouldn't be doing it for taxonomies that aren't even linked to the "classifieds" post type. A sensible fix would be to add the following:

    $post_types = get_object_taxonomies('classifieds');
    if (!in_array($taxonomy,$post_types))
    return $template;

    after $taxonomy = get_query_var('taxonomy'); inside get_taxonomy_template()

    That way - your overrides still apply - but only for taxonomies that link to the classifieds post type.

    Ivan

    @leewillis77

    I don't have a taxonomy.php file - largely because I don't need one. My taxonomy archives are rendered perfectly adequately through archive.php as per the template hierarchy you keep linking to That is - until Classifieds is installed.

    The bug is that the classifieds plugin breaks the standard Template Hierarchy behaviour - by no longer falling back to archive.php for taxonomy archives (The code at fault is get_taxonomy_template() in core/core.php).

    I *know* why you're doing it (See http://www.leewillis.co.uk/wordpress-custom-post-type-theming-is-broken/ and http://darylkoop.com/2010/04/06/modular-themes-why/) - but it's broken and while you probably do still need to do something similar - you absolutely shouldn't be doing it for taxonomies that aren't even linked to the "classifieds" post type. A sensible fix would be to add the following:

    $post_types = get_object_taxonomies('classifieds');
    if (!in_array($taxonomy,$post_types))
    return $template;

    after $taxonomy = get_query_var('taxonomy'); inside get_taxonomy_template()

    That way - your overrides still apply - but only for taxonomies that link to the classifieds post type.

    The plugin doesn't break the Template Hierarchy behavior, it simply loads the "taxonomy.php" from the plugin dir. If you don't need this template you can remove it from there. For future releases I may supply a fine tuned templates for only the default taxonomies which in some degree will resolve potential problems with existing archive.php templates.

    @evandowen

    Hello Ivan,

    Any word on when these bugs will get fixed as well as the issues on my site? You requested a login (I sent in via Contact Us page), however, it doesn't appear that you've logged in as of yet...

    Evan

    We are preparing all of our plugins for the WP 3.1 release and the next version release will include both the bug fixes and all compatibility issues resolved. You can expect it very soon.

    @Gayatriom

    Hi..
    How do i change the the name for the Classifieds section from 'Classified' to 'Directory'.
    I am using it with Buddypress!

    I am assuming, you want to change the "classifieds" post type labels. Go to [Content Types]->[Post Types]->[classifieds] and edit the labels.

    leewillis77

    The plugin doesn't break the Template Hierarchy behavior, it simply loads the "taxonomy.php" from the plugin dir.

    I understand what it's doing. However that breaks page rendering that was working before the install of Classifieds. By including files from outside of the user's theme you're stopping the default WordPress hierarchy code from falling back to archive.php, and you're doing so for taxonomies that are nothing to do with classifieds. I'm not sure how that's not "broken".

    If you don't need this template you can remove it from there.

    Yes, but if I do that, then the Classifieds taxonomies will no longer be rendered properly.

    For future releases I may supply a fine tuned templates for only the default taxonomies which in some degree will resolve potential problems with existing archive.php templates.

    I presume you mean providing taxonomy-cf-tags.php instead of taxonomy.php? That might work out-of-the box, but it wouldn't work for taxonomies that the user creates using the taxonomy admin UI provided with Classifieds (Unless you're going to dynamically create template files for them).

    The patch I provided in my earlier post should work for both of these cases without any changes to the template file you're shipping.

    Ivan

    I understand what it's doing. However that breaks page rendering that was working before the install of Classifieds.

    That's a CSS issue. The template works well for default themes and it needs some improvements so it can work reasonably well for custom themes. This is a front-end template and you can't expect it to work on all themes under the sun without some rendering inconsistencies. WordPress 3.1 brings new exiting things to the table (Post Formats) which will help us improve things in that direction.

    By including files from outside of the user's theme you're stopping the default WordPress hierarchy code from falling back to archive.php. and you're doing so for taxonomies that are nothing to do with classifieds. I'm not sure how that's not "broken".

    Yes, thats by design. As discussed previously I am advocating against using the "archive.php" in favor of using higher level templates for greater control. In the context of the Classifieds plugin, if you want you can copy your code from "archive.php" into higher level template like "taxonomy.php" or "taxonomy-taxonomy.php" etc. or you can simply remove the supplied "taxonomy.php" so you can use your current "archive.php". Also fine-tuned templates for the default Classifieds taxonomies can be created from the default "taxonomy.php".

    The patch I provided in my earlier post should work for both of these cases without any changes to the template file you're shipping.

    Your proposed solution doesn't take into consideration the fact that any user can add arbitrary number of post types which should not be treated differently than the "classifieds" or any other post type.

    In conclusion, I want to thank you for the time you are taking to discuss this with me but I must say that your point of view about the plugin is very narrow and it comes only from your particular implementation of the plugin. Your proposed patch is a hack for your particular implementation. Many people have different needs and different setups. The plugin is far from complete and I will appreciate your input on all matters of concern to you but please think through all the possible scenarios and try to understand the whole concept first. Last, the plugin is licensed under GPL so you don't need anyones permission to modify it however you like.

    leewillis77

    Hi Ivan,

    Firstly, thanks for taking the time to respond, and apologies if I seem to be banging on and on about this, but evidently I'm not doing a good enough job of explaining the problem - and for that I apologise.

    This will be my last post on the topic, and please don't feel obliged to respond - I'm genuinely just trying to minimize problems for other users who have custom taxonomies linked to post types other than "classifieds". I'm also happy to provide a test site if you want to see what I believe the problem to be - just drop me a note (http://www.leewillis.co.uk/contact/ if you don't have access to my email address)

    The problem (In my opinion) is that taxonomy archives relating to taxonomies created independently of the "Classifieds" plugin, where the taxonomy is not linked to the "classifieds" post type are rendered using the taxonomy.php file supplied by Classifieds rather than the default template provided by the user's theme as per the Template Hierarchy.

    [Note: I also posted a "Feature Request" related to taxonomy archives which I suspect is probably unique to me, but I believe this issue here will affect anyone who has a custom taxonomy]

    That's a CSS issue.

    It's not a CSS issue - it's the fact that my custom taxonomy, which is linked to the "post" post type, and is not linked to the "classifieds" post type is now rendered using an entirely different template (wp-content/plugins/classifieds/ui-front/general/taxonomy.php) than the one it is before I activate classifieds, and a completely different one than the template hierarchy (wp-content/themes/arras-theme/archive.php) would indicate (Given that the theme in use doesn't have a taxonomy.php).

    This is a front-end template and you can't expect it to work on all themes under the sun without some rendering inconsistencies.

    I agree - however there's no good reason that Classifieds needs to change the choice of template file for a taxonomy that isn't linked to the "classifieds" post type. That is what my patch implements.

    Yes, thats by design. As discussed previously I am advocating against using the "archive.php" in favor of using higher level templates for greater control.

    Yes, but on one hand you're saying "let's stick with the Template Hierarchy", but here saying I can no longer rely on standard template hierarchy behaviour after I've installed Classifieds.

    In the context of the Classifieds plugin, if you want you can copy your code from "archive.php" into higher level template like "taxonomy.php" or "taxonomy-taxonomy.php" etc. or you can simply remove the supplied "taxonomy.php" so you can use your current "archive.php". Also fine-tuned templates for the default Classifieds taxonomies can be created from the default "taxonomy.php".

    Yes, as I acknowledged earlier in the thread I can, this does work, but I shouldn't have to do this - for archives which are in no way related to the classifieds taxonomies, or post types.

    Your proposed solution doesn't take into consideration the fact that any user can add arbitrary number of post types which should not be treated differently than the "classifieds" or any other post type.

    I think that it's reasonable for the plugin to override the template choice for post types / taxonomies created by the plugin itself.

    However I do believe that custom taxonomies / post types created independently of the plugin *should* be treated as per the standard template hierarchy, and should not have their template overriden by the plugin.

    I accept that my patch assumes that it can tell whether the template should be overridden by checking if the taxonomy is linked to a post type called "classifieds", and that that doesn't cater for the user creating additional post types through the classifieds plugin.

    Your proposed patch is a hack for your particular implementation.

    It's an attempt to fix a problem that will be experienced by *anyone* who has taxonomy archives created for taxonomies that aren't created for Classifieds. As you mentioned it possibly doesn't go as far as it needs to in terms of identifying the post types to check - but I believe the principle is sound.

    Again, thanks for taking the time to respond so far, don't feel obliged to again - I won't reply to this again unless there's anything you want clarification on.

    All the best for the New Year ...

    Mason

    Hiya G,

    I'm gonna ask that you open a specific thread on this as this thread is getting crazy long! I'm gonna unsticky it and close it up for now.

    When you post your question, give us more information like where you've changed the settings from Classifieds to Business Directory and if the navigation menu you're referring to is on the admin side of things or the front end.

    We'll help ya get this sorted!

    Thanks!