I was looking at the output for Drupal’s list of polls (the page that appears at example.com/poll) and thinking that it is frankly a bit cr@p. No page title (though that may just be a Snafu in my theme), no bulleted list (it’s crying out for that) and poor text formatting.
Can I create a custom template, like you can for some other output that doesn’t have a core template? Or, is it a task for the dreaded template.php overrides (which I always hate trying to come up with)?
But that cannot do anything to fix the absence of a list element, the absence of a title or the bad text formatting (“I mean, hyphens instead of em dashes? Really, Drupal developers, you should do better”). Sounds like it’s time for someone to start reading posts more carefully.
Well, then I look forward to your version of this older polls thing … after you perfect it and contribute it.
By the way, I believe there should be a file in modules/polls named poll-results–block-tpl.php. Copy that to your theme folder, and you can adjust how poll data is displayed in that template file, if I’m not mistaken (it’s been a while since I’ve used a poll). Also double-check your poll block to make sure the title is published, along with the module’s configuration to make sure you’re not missing something.
I don’t know about the whole “can’t be any clearer thing.” You could probably work on that part a little more – no offense. Anyway, assuming we’re talking about the Polls module (which I believe we are), then the templates are where you would control all of the output and how it is to be displayed, from the title to the votes, links … everything is available to you as variables that you decide how to display or whether to display it at all.
Example: " <h1>$title</h1> " would display your title in an h1 tag.
Conversely, “<span style=“color:red;”>$title</span>” would take your title and make it red and and so on and so forth.
If it’s a problem with the data itself, then you could do a template preprocess function (template_preprocess_poll_results()), or modify the module itself.
Unless this is some “special” drupal module that does everything completely different from every other module, which I somehow doubt.
list of polls (the page that appears at example.com/poll).
This page’s output is not altered by templates from the Poll module. I don’t see how I can put it any clearer than I have. Hence asking whether a custom template, such as can be used for theming content that does not have an existing template (e.g. the contact form), would be a solution.
I could give you a lot of suggestions on how you could put it clearer.
For example: “My issue isn’t with how the individual polls are displayed, but how they display as a list, and within that context only. I want control specifically over the list view.”
That would have been much clearer, but that’s neither here nor there. Anyway, if your issue is with how they are viewed as a list, then you should be using VIEWS to put together your list of polls, and this will give you the control over their display that you’re looking for.
Ok, I’m a little late to the game but I don’t really understand what your issue is with Polls. I haven’t had the need for using Polls before but I fired them up on a D7.12 site just to have a look and made a simple Poll to test them out. on my list page (example/poll) the title is where it should be and the polls are listed in a standard unordered list.
That does not reflect at all the output that I get. Take away your H1 and replace your list items with divs and you are closer to what I see. And, even if I could determine why your installation has produced those elements, your example snippet still has the poor text formatting after the anchor that—as far as I am aware—cannot be altered.
Everything that is outputted to the browser can be altered. You can either alter using _ _ _ tpl.php or template.php but that doesn’t explain why you’re getting the results have described.
Something must be broken by your theme or some custom code somewhere. The site I ran my test on is a bare bones D7 installation. It contains zero custom code and I’m running an unadulterated copy of the Taraski theme (http://drupal.org/project/tarski) because I wanted it to look pretty without having to write a theme for it.
Edit: I see your point about the text formatting in the anchor. I think that should be able to be changed via one of the poll template files but if it really bothered me I’d follow CMS_Dude’s lead and make a new list with views so I could fine tune it exacty the way I want it to be.
So if I were interested in modifying the markup in the link I would override the function poll_page() with my own themename_poll_page() function in template.php and change the way it outputs the markup.
It might be that your theme is already doing that (causing the weird output) if you built your theme based on another like Zen or something.
Unless he has a “bootleg copy” of Drupal 7. I’m at a loss.
CMS “dude”, I would not normally comment upon other people’s styles, but I think that you have been completely unhelpful here. I was following this thread to see if it had any useful advice (I’ve just built my site with Drupal, and this theme/template thing is not easy to grasp), but all that you have done is tell this person to use CSS to fix things that even I know can’t be fixed with CSS and then belittle him/her for calling you on it. You should be more polite and constructive.
Mat30: the template system is not easy to use, I know (and I’ve had to ask quite a few questions about it here). The only advice that I can give is that you can copy any of the functions that are in the included files and put them in a modified form in the template.php file to over-ride them.
Well, since we’re talking about manners, being polite and constructive, might I suggest the following reply, then:
“Thank you for your reply, CMS Dude, but unfortunately I’ve ruled that one out, and this doesn’t appear to be a CSS issue.”
Would that have been so difficult?
Look, I don’t mean to lecture some of you guys like your Moms or bully you around like your older brothers … but if there’s one piece of advice I could give to you … that is to be gracious and thankful for a reply, regardless of your perceived value of the reply. You will get a lot more help from people that way – always. Ultimately, you will seek out answers in your own way, and hopefully you will be successful with it. But seeing as how it’s been about 3 days since this question was asked, and still no definitive answer … I’m guessing there’s probably a better way of asking for help. Good luck on your sites, guys!
I think it’s difficult to gauge the intent or emotion from written words on the screen and I think that’s why sometimes things can get a little heated on help forums. I’ll add that although I don’t know CMS Dude, I think he’s been very helpful and knowledgeable in many posts I’ve seen. If I were to take a guess, I would guess he was maybe trying to add some levity to the topic seeing as Mat30 was a bit inflamed in his initial posting trashing the core developers at Drupal for something clearly beyond their influence.
Maybe his post (Sounds like it’s time for someone to start flexing some CSS muscle) was a bit cheeky but if Mat30 came back with something like “thanks but that isn’t the issue… The markup is coming out broken, etc…” then they could have moved on and found the solution. Yeah, it gets frustrating working with one of these massive CMS systems when you first get started but if CMS Dude hadn’t answered the initial call for help and I hadn’t happened by, I’m not sure if the post would have been answered at all.
Aside from that, I’m curious about whether Mat30 found a solution to the problem