Hello, sorry if this is already recorded or discussed, but I could not find it when searching.

On some of my sites I have a lot of theming I need to do at the tpl.php level.

I have a few suggestions on how to improve the Views theming system:

1.) It would be great if the suggested file name included what level it was at, so the word "style" for style, "row" for row etc. Right now when I glance at all of my theme files, it is hard to tell what I am looking at via FTP unless I go to the view and check the suggested template names to see which file is which on the server.

2.) Even better, it would be great if particular views could have all their theme files placed into a folder. Ideally a folder level for all views-theming, and then another folder for each view. granted some theming will apply to multiple views [tags] or multiple views [top level theming] and those could be kept in tag-named folders, or some other top-level named folder [all-style, all-rows etc.]

Or, the folders that one makes under some folder name could be irrelevant to Views, it would just be smart enough to search all sub folders inside of that folder, and then the developer can organize them in sub-folders inside of a folder called "views-themes" as s/he pleases.

So, combined, this would give me a way to organize the 2 dozen or so files that often crop up into groups, and to also be able to directly edit the files from the FTP view without having to reference the View itself to see which name is which part of the theme.

views-[name]-[style]-[level]-[tag]-[page]-[field].tpl.php

would seem like a logical naming convention to me... but i might obviously be missing some fundamental reason for the naming conventions right now; even though i don't always see the logic!

Thanks for your time, and great work on Views!

Best,

Seb.

Comments

merlinofchaos’s picture

Status: Active » Closed (won't fix)

Renaming the templates at this point is unlikely to happen -- imagine the upgrade hassles that's going to create for the hundred thousand (or more) people using Views.

You can arrange templates in your theme in directories however you like.

schedal’s picture

Thanks for the comment Merlin, I realize that renaming would be a pain; so my thought would be a radio button in a config-page to change over to the new naming system. This would be something that people on new installs might opt for.

With regards to moving the files around, I have tried moving them to sub folders, but then the display generates 'file not found errors'. If you are saying that this is indeed possible, then I'll have a deeper look into my situation; maybe I just need to press 'rescan' [however doing that for 24 tpl files could prove overly time consuming!]

Thanks again, Kindly, Sebastian.

merlinofchaos’s picture

Status: Closed (won't fix) » Active

Can you give more information on the file not found errors? Where do you get them?

The discovery of templates is handled by core, I don't think Views would actually care where they reside and core searches directories to all depths. There could be something I've missed but I thought I had tested that once, long ago.

dawehner’s picture

Category: feature » bug
Status: Active » Postponed (maintainer needs more info)

Sadly no reponse, perhaps a update helps.

esmerel’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)