Closed (fixed)
Project:
Classified Ads
Version:
6.x-2.0-alpha4
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
24 Jul 2009 at 05:50 UTC
Updated:
16 Aug 2011 at 09:41 UTC
Theming is presently supported by functions, this request is to allow (and test) themable templates so that users can create/edit their own *.tpl.php file to truly configure Classified Ad display exactly as they'd like.
Comments
Comment #1
jamesialford commentedI would love this. I have been working on this for weeks and can not get a good theme to work. realy, all I want is to add a Button on the right for the picture "Buy Now" this will send out a Privite Message to the seller.
Any help would be great.
James
Comment #2
jamesialford commentedMiles, I will be more then happy to help out testing this. I have several sites that I am using for testing.
James
Comment #3
milesgillham commentedI feel a little badly about this item. I created it before I had understood more about ed_classified and theming. It really is more of a todo item to test more aspects of theming for frills, bells, whistles.
See #591670: Overwritting standard ad display (list) and #460436: Classified ads node tpl not working.
Copy node.tpl.php to node-ed_classified.tpl.php in your theme directory. Remember that ed_classified does not use a different base type, it's just a node with benefits. You're going to want to be able to pull out the node owner and other details so that your links/rules have the right params. Doing a node_load on $nid should see you right (e.g.
$node = node_load($node->nid);) Obvious ones already present include: $nid, $uid, $nodeUse something like this to see what variables you have available if you're not sure:
Is that helpful?
Cheers,
Miles
Comment #4
jamesialford commentedThank you Miles, In your opion would you use 6.x-2.0-alpha6 or the bata version. I know sometimes the bata version is the same but, with a few updates. Is this one of these times?
James
Comment #5
milesgillham commentedAt this time the latest recommended version is alpha6.
Cheers,
Miles
Comment #6
jamesialford commentedMiles, I am using the alpha4 version.
I would like to document my process so, anyone who is having trouble can find it.
Here is where I am standing. I renamed the node.tpl.php to node-ed_classified.tpl.php in my theme directory sites/all/themes.
I can add things to the node-ed_classified.tpl.php it will change the classified ads.
I have rules and links installed. I have not done much with them yet. I do not know much about these two modules. I am reading the documents before I work on them. If you know of some thing that will help us out, Please post it.
I will post more after I am finished reading.
James
Comment #7
milesgillham commented@James:
Just with respect to the wording of your documentation - I hope you copied not moved node.tpl.php to node-ed_classified.tpl.php or bad things might happen to the rest of your nodes. Do you mean, sites/all/themes or sites/all/themes/ where you did this? That is, the name of your currently active theme?
You may need to occasionally flush your caches for changes to show up (I expect you already know this, just a warning to others as sometimes we all forget).
Upgrade to the alpha6 version if you can. It's better.
Cheers,
Miles
Comment #8
jamesialford commentedMiles, Yes I copied the node-ed_classified.tpl.php to the sites/all/themes/mytheme directory.
flush the caches I do almost every time I do some coding updates. Here are the steps for the people needing it:
Goto admin/settings/performance
Under the "Clear cached data" click the button for "Clear cached data"
You are done.
James
Comment #9
jamesialford commentedI am at the alpha6 version now.
Comment #10
jamesialford commentedMiles, I do not see where to pull out the node owner and other details. Can you advise?
Here is my node-ed_classified.tpl.php
Comment #11
doerno commentedThank you Miles.
Purnomo
Comment #12
fgm@amesialford gave a solution on #10 to theme Classified Ads nodes.
More generally, themability has been simplified in 6.x-3.x: theme functions have been replaced by templates for the expiration "widget" on nodes, and it can also be moved within the node rendering without having to code by using CCK Build modes at
admin/content/node-type/classified/display/classifiedfor ads lists, and atadmin/content/node-type/classified/displayfor normal displays.