Farmers helping farmers farm better through collaborative efforts.
|
NavigationUpcoming events |
Recipe for Classifieds in Drupal 4.7If you are an Active Farming member or visitor, I'm sorry but this page has nothing to do with farming. This is a technical page about the platform we use. Recipe for Classifieds in Drupal 4.7. This is a recipe on how to get Classifieds in Drupal 4.7 like: http://www.activefarming.org/classifieds Overview: This recipe uses these (up to date) items:
1) The first thing you need to do is create a custom flexinode. Create the fields that you want people to be able to enter. Some recommendations are: Title, Description, Name, Email, Phone Number, Price, and Pictures. Do not create fields that you would want people to be able to filter the classifieds by (state, category etc). 2) Create Categories (taxonomy) with the terms you want people to choose from and assign your flexinode as "type". I would suggest having at least:
3) Create a custom template.php file in order to use a custom node-flexinode-*.tpl.php file. 4) Customize your node-flexinode-*.tpl.php file where * is your flexinode number. Be sure to add your taxonomy "categories" to the node in a way that will make sense to the end user. 5) Create a custom "view" using views.module. Make it a "Page" and "table view." Next, choose the "fields" you want shown on the classified table view. Next, choose the filters you want the type to be able to be filtered by. Choose which filters you want to "expose" to the end user. Next modify all the permission and misc view settings to get it to appear the way you want. 6) Next, edit your style.css file to get the classifieds to look the way you want them to. You can adjust the tabs, colors, padding, etc... 7) Visit "access control" and make sure you set role permission for creating your classified ads. 8) That's about it! This is my first attempt at creating a "recipe" for drupal. If you have any questions or if I'm not clear enough on a point, please let me know. I'm sure I'll have to make some changes to this once I get some feedback from other users. Once I get a more final copy, I'll submit this to the Drupal Handbook. I may also be willing to install a classified on your site if you need help for a fee. Contact me for information. Yes, you want to create a multiple main vocabularies with multiple terms in each. For example, in "Regions" you want a term for each state etc... Then make another "vocabulary" for "Category" and create terms inside of "Category" such as general merchandise, clothes, cars, trucks, etc... A couple more questions... 1) I only just became aware of the "Content Creation Kit" (CCK). Have you looked at this? (I'm a little worried that it may be "the next big thing," particularly if it replaces flexinodes.) 2) If one wanted to do a conventional classifieds section, a la craigslist, then different ad types would require different forms. For example, you would have different fields in a "jobs" listing than you would in a "for sale" listing, etc. Is there room in your scheme for different forms? I appreciate what you have done here. Forgive me if I ask too much? From what I've read in the past about CCK is that they are working on a module to go with it that will update a site from flexinodes to CCK. I'll look to see if I can find where I read this at. Good... Right now, CCK seems pretty raw. I can't find much on the way of documentation for it. And I really like the idea of having a picture field, and CCK doesn't appear to have one. Otherwise, I might give it a shot. I'm at the point now of trying to grok how to lay out the fields in a flexinode. (Seems ripe for some kind of js layout applet.) Then it's on to the views piece. This is pretty interesting for a relative newbie...
Just following the instructions in this section of the Drupal Handbook: It's fairly simple to customize your layouts. Just create your template file and then custome flexinode tpl files. To add specific taxonomy to a custom flexinode tpl file use something like: $terms14 = taxonomy_node_get_terms_by_vocabulary($node->nid, 14);
if ($terms14) { print 'Type Of Classified Ad: '; foreach ($terms14 as $key => $term14) { $lterm14 = l($term14->name, 'taxonomy/term/'.$term14->tid); print $lterm14.' '; } print ''; } Enclose in PHP tags. Replace "14" with your vocab id # and replace "Type Of Classified Ad:" with the label you want I am stumped. I am unable to find Flexinode for 4.7. I have searched and it appears to me that the most recent module is for 4.6. I've had bad experiences in the past with not using the right module for the Drupal version. Gracias! Ben Any thoughts on how I can install Flexinode in 4.7? Thanks, Ben Hi Ben, I have succeeded in implementing your scheme, though I had some difficulties working things out with taxonomy access, and with getting the filter settings just right. Have you thought about how to handle deletion of items? It would be really nice to have edit/delete buttons in their own column, to the right of items that the current user has edit control over, but I'm not sure how to approach that. Thanks for doing this! It's wonderful! Thanks for this recipe. Any idea how to filter the view to only show classified from the last 2 weeks (or similar time period)? I am using CCK + Taxonomy for my classified ads. I have set-up the views and this works fine. However there is something I cannot do seem to configure: Those last 2 fields are linked to the a url: taxonomy/term/ when clicking on a link I have a list of my ads for that category containing teasers for the ad. Create another view for terms pages. This also prevents search engines from seeing 404 errors if the category is empty. So the view for the terms then override the defaut taxonomy/term/ view in that case? Yes it will override the default view. There are some examples of this in the view's project issues section of the drupal website. Hi, I am a newbie to drpal and a bit confused about creating the custom tpl file. I would greatly appreciate it if you could shed some light on my dilemma. I have created custom content types title, name, address which are 3 different flexinodes. I have also created vocabulary (e.g. Region) with terms (like north, south). When I preview the vocabulary "Region" form the drop down menu contains the "" option but not any "" option. How can I fix this? Secondly, In http://drupal.org/node/45475 Do I just edit the "flexinode_9", ....,"flexinode_12" portions of the code and point them to the the 3 flexinodes I have created while leaving the rest of the code unchanged? How will this be linked to the vocabulary I have created? Thanks in advance, Thanks for sharing this. I think I'm close to getting it set up on my site. What did you use for getting images into your flexinodes? drb Hi i am trying to implement similar functionality on my site, but am not able to grasp as to how to implement custom view for terms. Can you please elaborate a bit? I'd be highly obliged. and how do you put these on top of the page?? are they diff views or what? * Classifieds thanks in advance, Sham ok this much done.. only thing.. how do you populate the drop boxes with "all" by default? |
User loginNew forum topics
|
In step #2, I take it that you when you say "Create Categories (taxonomy)" you actually mean "Create Vocabularies and Categories?" For example, Regions would be one vocabulary, Category another, etc.
I'm implementing your scheme and want to make sure I'm doing it right.