Hi, I apologize if this is an obvious question, but I've searched all over and can't seem to find an answer. Is it possible to display different classified ads on different pages within the same site? Currently, all of my ads are listed on a single page, and in time, I think this could get unwieldy. Please let me know if it's possible to display them as such and, if so, how it's done. Thanks in advance for your time!
Comments
Comment #1
fgmNot sure I understand your question. It could mean that:
- you worry about the listing page becoming too long when there are many ads ? there is a pager on the secondary page at /classified/, and one on the per-user ads page at /user//classified. The main page at /classified list categories, so its length is under your control.
- you worry about ad blocs always showing the same ads ? nothing prevents you from definint other blocks, especially using Views
- you want a different listing page ? Create a view with a page display and use it instead of the default page provided by the module. You can even hide that page by hiding its menu entry in the menu administration.
Does it answer your question ? If it does not, please clarify what you want to achieve.
Comment #2
Drupoth10 commentedThank you for your response and for this helpful information. I just want to display different ads categories on different pages (at the moment, all of my ads categories are lumped into one single page). I may try to figure out how to use Views to make this happen.
Your notion of the "pager" is intriguing to me, because I don't want the pages of posted ads to get too long. I'm not finding any documentation on how to integrate pagers into classified ads pages anywhere, though. Can you please point me toward any documentation on how to do this if you know of any?
Also, I'll report back if I can't figure out the Views approach. Thanks!
Comment #3
fgmTo obtain multiple pages, the way suggested by Classified Ads is to have multiple hierarchical ad categories: that way, every subcategory goes to its own page. You can have multiple levels.
Beyond that, you can create Views filtering on the Classified Ad node type, and display them as you want: other pages, blocks, whatever.
Pagers are activated automatically when any ads page gets too long: there is nothing you have to do for this, a pager will appear automatically as soon as the number of ads for a given category reaches 10 ads. It is not affected by the number of categories, only the number of ads in a category.
Comment #4
Drupoth10 commentedThanks for your response. I like Classified Ads' ability to display multiple heirarchical categories. However, on my site, the different categories sometimes don't have much to do with each other, so it seems odd that they should all appear on the same page; that's why I want to break them up over multiple pages.
I've been messing around with Views, which is great overall, but I can't figure out how on earth to show different ad categories on different pages using Views. This may be more of a Views issue than a Classified Ads issue, and if so, feel free not to respond to this question—but is it possible to display different ads on different pages? I think I understand how the filtering function works, but I don't see how it would allow me to place different ad categories on different pages.
Also, the types of information that appear in content in some of my categories wouldn't make sense in other categories (for example, in one ad category, people can advertise for services rendered, i.e. book cover art; in another category, I want people to be able to advertise books they've written). Is there a way, when adding an ad, that people can be redirected to different forms depending upon which category they're going to advertise in? Or am I dreaming? Thanks in advance for any insight you can provide.
Comment #5
fgmIt looks like you are trying to build a quite customized experience for ads, and Classified Ads might not be the best choice for that: you can replicate most of its functionality by using "meta" modules like Views for display, Scheduler or Rules for automatic publishing/removal, PrivateMsg or Notifications for notifications, and maybe some custom code for advanced redirections between categories.
Classified Ads is intended as a prepackaged solution for the traditional hierarchical model, that anyone can deploy on a low-end site without spending lots of time integrating with something else, not as the basis for more advanced services.
Comment #6
fgmNo comment in over two months. Assuming fixed.
Comment #8
System Lord commentedGreat module! Thank you.
This may be in line with what was asked in #4, but just want to be clear. I've been adding categories as needed to the tax terms and all works great. This is because they all can use the same default fields and even some that I've added conditions to (conditional fields). For example a Price field visible when creating a For Sale ad and a Compensation field visible when creating a one-time gig. But, now i want to add a Job category that will have a hand full of additional fields that wont have any purpose or use in For Sale or Wanted, or one-time gigs. I suppose i could still use conditional fields to make this work, but there must be a simpler way. Like a second instance of Classified ad - content type? I hope it makes sense what I've wrote.
Thanks
Comment #9
fgmHello @System Lord
I do not think there is a way to do this cleanly with Classified Ads. The module has been designed to be a packaged solution for simple cases, and as such can only handle one content type and one hierarchical vocabulary.
To go further, you will probably need to build your solution from scratch with custom content types, custom views, something like Rules and Notifications to handle expiration conditions, and probably some custom code to handle the hierarchy navigation. Or play some subtle tricks with conditional fields as you imagine, but at this point, I think you are overstretching the module and should rather build something to your needs instead.
Comment #10
System Lord commentedTake this as a compliment, but I don't like when you down-play your module :) Not just in this thread, but in others as well. I fully intend to use this module for large capacity/volume participation. What's nice about it is that it DOESNT have all the bells and whistles (overhead) that the big boy competitors have. That's me, tho, and for my build.
Call my crazy for suggesting this, because I really don't know anything about module building, but isn't possible to simply change a name of a few files and "calls" in the existing ed_classified module and save as a different module/project? Like /project/ed_classifieds_b, or /project/ed_jobs? To where I could install it along side the original ed_classifieds?
Comment #11
System Lord commentedWow! I guess I'm not crazy! It worked!!!! I now have a new Classified Jobs module installed and a new Classified Job content type! I haven't tested it yet, but I was stunned so I had to post this. Other than checking to make sure this actually works, this has to change the licensing somehow right?
Comment #12
System Lord commentedNo big issues yet. When I have both modules loaded I get 12 of these warnings in Status report:
Warning: strcmp() expects parameter 2 to be string, array given in _system_sort_requirements() (line 2785 of /home/pcage0/public_html/site.com/modules/system/system.module).
They refer to:
/**
* Helper function to sort requirements.
*/
function _system_sort_requirements($a, $b) {
if (!isset($a['weight'])) {
if (!isset($b['weight'])) {
return strcmp($a['title'], $b['title']);
}
return -$b['weight'];
}
return isset($b['weight']) ? $a['weight'] - $b['weight'] : $a['weight'];
}
I also have one of these warnings:
Warning: usort() [function.usort]: Array was modified by the user comparison function in system_status() (line 2320 of /home/pcage0/public_html/site.com/modules/system/system.admin.inc).
In the Status report there are alert icons for these modules with only "Array" written in the lines.
However, if I disable ed_classified and leave the "classified jobs" module all the errors go away and Status report gives me a green light. So, obviously the modules are clashing somewhere. Taxonomy? Path? Maybe something in: jobs_context_condition_path.inc...
/**
* Condition form.
*
* @return array
* A form array for the condition.
*/
function condition_form($context) {
$form = array();
$form['1'] = parent::condition_form($context);
$all_paths = explode("\n", $form['1']['#default_value']);
$jobs_paths = $this->get_jobs_paths();
sort($jobs_paths);
$common_paths = array_values(array_intersect($all_paths, $jobs_paths));
sort($common_paths);
$form['2'] = array(
'#title' => t('Auto Jobs path set'),
'#description' => t('Helper: merge all paths belonging to the Jobs Ads application into the above list.'),
'#type' => 'checkbox',
'#default_value' => $common_paths == $jobs_paths,
);
return $form;
}
I know I'm completely off track in this thread, but I wouldn't know where to put it. Cloning this module is going to work perfectly for my use. If you have time, please respond.
Thank you
Comment #13
fgmNote sure what you did exactly: could you post a patch of the changes you did over the normal module ? Or just post your module here, or preferably in a separate issue, because this no longer seems to relate with the original topic of multiple category dimensions.
Comment #14
System Lord commentedThanks, fgm! I'll create a new issue "Cloning ed_classified" and respond to your questions there.