Re http://drupal.org/node/223440

Lee Hunter: This seems to need an example or a better description. I understand what it's saying (I think) but I don't understand how it's used. I'm also confused by screen capture from the devel module. Is a "candidate" the same thing as a suggestion? What is the signifigance of the three candidate files? Why would I choose one and not the other?

----
Me: There's a specific-is-higher priority scheme for the override taking effect on any given page load. In this case, when node 297 loads, tne leftmost will take precedence over the more general ones, if it doesn't exist, then the one specific for full-node displays, and if that doesn't exist then the general page template (and if that doesn't exist then core's?)

Whoops, breaking my own guideline for using Diigo. Since this is a substantive content question, I think this would be better posted to the doc issues queue with a link. That will keep the Diigo comments focussed on tagging and navigation placement as I intend. I don't want people saying this medium is splitting dialog flow that should be on d.o. Plus you'll get better responses there, more actual theming experts there :)
----
Shai Gluskin: There is definitely a fine line/grey area here that is hard to figure out regarding what level of writing this group is tasked to do. I don't think this group is simply tasked with organization. I think the, marked paragraph on this page is incomprehensible! Of course, this stuff is indeed hard to describe.From what I remember, Ric Shreves did a good job of describing this concept in "Drupal 5 Themes" (we, of course need to be careful about plagiarism -- but nothing wrong in looking at a good model).

Since when do we have the terminology "template suggestions"? I prefer "candidate" over "suggestion". How about changing the title of the page to, "Creating Template Files for Theme Customization" or "Creating Derivative Template Files for Theme Customization". The latter is better, but I don't know if the word "derivative" reminds people too much of calculus :)

Comments

HansBKK’s picture

Shai I'm answering here as per our Diigo usage guidelines - please try to follow them rather than creating the extra work for us to have to copy and paste substantive content discussions back to here.

The problem isn't what kind of editing we're doing, it's where we're holding the discussions about what parts of the project.

I want Diigo to be used solely for "meta" issues like topic tagging and (growing out of that) navigation hierarchy placement topics. Discussion relating to the content itself should take place here so it involves the whole docs team, as will summaries of the "meta" discussion once they imply major decisions needing confirmation.

I'm just trying to prevent splintering of discussion media, it's hard enough to get good feedback and build consensus, we should have hard edges to what kind of discussions take place where. IMO - anyone is welcome to push back on this policy (here) if you think I'm being unreasonable. (and support on this would also be welcome if you agree with me :)

My new comment on this actual content topic:

I believe both template "suggestions" and "hints" are correct terms with precise meanings in drupaltech, but they are jargon that should be explicitly marked as such and defined.

HansBKK’s picture

And regarding content issues keep in mind the best practice from an efficiency POV is to just go ahead and make the edits you think are appropriate, and then express any doubts or questions you may have here with a link.

It's much easier for someone with a higher skill/experience level to then just go and revert or clarify the content itself than it is to discuss stuff back and forth!

If you're not confident of your topic-expertise, go and do the research before doing anything, you'll learn a lot as well.

For example, this google search: template hint OR suggestion (my customized Firefox search engine for drupal.org automatically puts the site:drupal.org at the end of my search string) shows you some relevant pages that help you understand this (used to be) unfamiliar jargon.

Regarding your other questions, they're just plain English, but admittedly at a higher level of vocabulary:

candidate = one of a set of choices (as in an election or hiring process)
derivative = not the original but a modified version

And as a final note, as Sepeck pointed out, tone of voice is very important here. dvessel has created a fine set of docs here, and if they are pitched at a higher-than-newbies level of understanding, that's a minor issue that can easily be fixed (especially by learner docteamers like us!) by both content editing and re-organization (sub-pages marked "advanced: xxx", one of the classification factors I'd like see use using for tagging on Diigo)

With a bit of research on our part, the content is suddenly no longer "incomprehensible", and the process also helps all of us climb that steep learning curve that is Drupal!

Thanks for your input, and please don't take my comments as anything but constructive, just trying to be helpful.

Shai’s picture

For those shrugging at "What's Diigo"?... it's a web tool that a drupal docs subcommittee is using to upgrade, help organized the Drupal theming manual. If you want to help... contact HansBKK? --- but I may be talking out of turn.

To HansBKK: You've been a great policeman at defining precisely what Diigo is for and what it is not for in this context. I think you have it perfect. Keep up the good work.

As for the content discussion on how to name the Template Suggestions page or describe the custom templating system... thanks for the directed search idea to garner background to the topic. And also thanks for the encouragement in true "Wiki" culture to be empowered to make edits.

Since I'm working on the Getting Started guide and some CVS docs pages right now... I think I'll back off on this issue for now. I was curious about Diigo --- and I've got a big "mouth" AND I'm a generalist (I can have opinions about things I know little about :) --- hence my jumping in. I'll keep an eye on this but don't expect to be too active.

Thanks for the great leadership on this.

Shai

add1sun’s picture

OK, so I saw the dupe of this first and posted a comment there, which I see has largely been addressed, but I'l copy my comment here anyway:

just FYI, "suggestions" is what it is referred to in the code and how I have always heard them referred to. i.e. it is a common term for many people already familiar. Candidate was a new term added by theme dev module and not one that have ever used myself, nor is it used from within Drupal anywhere. I don't say this to say "you have to use suggestions" but just to point out that for people already familiar with that term from theming for several versions of Drupal or who are looking at the code, candidate may mean absolutely nothing to them. So, please be clear that what you (or theme devel) call "candidate" is actually called $suggestions in the code (in theme.inc). (The term coming from this thinking, "Get suggestions for alternate templates...," taken from the comments in theme.inc.)

So how about Creating Alternative Template Files for Theme Customization?

HansBKK’s picture

Shai, thanks for the support.

For others, all you have to do to join the "theming re-organization workgroup" (not subcommittee :) is to

  1. be a docs team member
  2. join Diigo and play around to get familiar
  3. go to the Diigo drupal-docs group page and request membership. Heather's agreed to help get people in quickly, help with time-zone issues.

You can do whatever you like with your own private bookmark/annotations of course, but for now please limit sharing to the group ones commenting on theming-related drupal.org pages.

I'm working on defining some standard group tags we'll use to classify these. Unfortunately Diigo doesn't use hierarchy or define separate vocabularies, so I right now I'm thinking of using prefixes to distinguish other "classification factors", like version-applicability, skill-level and significance, from the main "topic" tags.

I'm hoping one day docs-team members can do this right in d.o., perhaps with Flag module?

HansBKK’s picture

add1sun - That's a great title for the overall general topic introduction, that'll end up being a parent of this particular page's more specific details on suggestions.

In fact the page currently below this one is already IMO a more general overview, and could be parent of this one, or at least ahead of it in the page ordering - could someone please do the latter for now?

This reminded me of another upcoming problem with the project, I'll create another issue.

Edit: #337701: Nav hierarchy depth limitation - use greater "width"

arianek’s picture

so... i don't really understand what diigo is, but it would appear it is no longer being used (the fact that i haven't heard of it, makes me suspicious!)

as far as the original issue - can anyone provide an update?

leehunter’s picture

We experimented with Diigo for a while, mostly to gather suggestions for reworking the theming guide. It's a web service that allows you to share comments on any web page with other logged in Diigo members. It was interesting to have a private editorial discussion right on the page. The major downside, in my mind, was that there didn't seem to be a way to remove or expire comments that were no longer relevant.

Re. the template suggestion page, I still find the introductory paragraph to be rather vague and unhelpful. "Template suggestions are alternate templates based on existing .tpl.php files. These suggestions are used when a specific condition is met and a matching file exists. All layers from core, modules, theme engines and themes can provide the suggestions. You can think of them as naming hints telling the system to pick and choose based on the right circumstances. The idea is simple but it is a powerful feature providing another layer of customization."

Perhaps it's perfectly clear to an experience themer but it means nothing to me. It would be really helpful if this started with a standard "You can ..." or perhaps something like this: "Using template suggestions you can display a page in different ways, depending on conditions that you specify. A template suggestion is an alternative template file that exists in your theme folder[[is that right?]]. The conditions that trigger use of the alternative template are specified in a preprocess function. "

I would also drop the bit about thinking of them as "naming hints". The idea of "hints" totally confuses me (I'm already confused by the ambiguity of "suggestion")

I'd rewrite this myself but, like I said, I'm not sure that I understand what's happening here.

arianek’s picture

Title: D6 theming - Template suggestions page (From Diigo) » D6 theming - Template suggestions page
Issue tags: +Documentation, +theming, +drupal templates

Thanks for all the info - that totally makes sense. Does sound like we need a themer type to go through and make this stuff easier to follow.

Have removed the reference to diigo from the issue title, leaving open.

Tor Arne Thune’s picture

Category: support » task
Status: Active » Needs review
Issue tags: +docs admins

Just some minor corrections to this page:

"This example add suggestions..."
Change to:
"This example adds suggestions..."

This code should be in php tags, not code tags:

function my_theme_preprocess_page(&$variables) {
  if ($variables['node']->type != "") {
    $variables['template_files'][] = "page-node-" . $variables['node']->type;
  }
}

and use drop as prefix, as in the previous example, because the code is an improvement of the previous code.

leehunter’s picture

Status: Needs review » Fixed

Looks like this page is good enough now.

Tor Arne Thune’s picture

Status: Fixed » Needs review

#10 is still not dealt with. The code example is still not in PHP tags and named my_theme_*. It's a quick fix :)

rootwork’s picture

I've made the changes. Relying on the folks upthread who said this was good to go, I've also removed the "needs technical review" status.

rootwork’s picture

Status: Needs review » Fixed

Oops. Meant to mark this fixed.

Status: Fixed » Closed (fixed)
Issue tags: -Documentation, -theming, -drupal templates, -docs admins

Automatically closed -- issue fixed for 2 weeks with no activity.