The Taxonomy VTN module has a built-in function to provide breadcrumbs, "_taxonomy_vtn_set_breadcrumb". Custom breadcrumbs via path, trying to override the breadcrumbs at taxonomy_vtn/voc/* don't get priority over the module.

Is it possible to override another module's breadcrumbs? I.e. custom_breadcrumbs via path always having priority over anything else?

Comments

MGN’s picture

Title: Path priority over module breadcrumbs? » Provide themeable output
Project: Custom Breadcrumbs » Taxonomy VTN
Component: Documentation » Code
Category: support » feature

Generally, it is possible for custom breadcrumbs to change the breadcrumb on a module's callback page, either through the theme level or by the module implementing custom_breadcrumbs api (details of this are described in the custom breadcrumbs README.txt file). At the theme level, custom breadcrumbs does this using hook_preprocess - but this would only work if Taxonomy VTN allowed theme overrides by providing themable output (using hook_theme).

I am not that familiar with Taxonomy VTN, but I have looked over the code in CVS. Right now, the code logic is not separated from the display - html is hard-coded into the module's callback pages and it does not implement hook_theme.

As far as I can tell, this means that the output of the module cannot be themed, or modified by other modules. Perhaps this could be a feature request for the taxonomy VTN module? To see if that is possible (or if I am mistaken), I am going to move this to the taxonomy VTN issue queue to get the maintainer's feedback on this.

AlexisWilke’s picture

Hi guys,

I totally agree. I'm thinking we should work on a version 2 that works better in several different aspect:

1) themes
2) caching
3) paging
4) columns

Just fixing up the current version may represent quite a bit of work that won't pay as much.

What do you think?

Thank you.
Alexis

adrianmak’s picture

subscribe

scotthoff’s picture

What do you mean won't pay as much? You mean, it might be better to just start from scratch and do better?

I also noticed some of these issues..

AlexisWilke’s picture

Scott,

Yes. I think starting from Scratch with a good idea of what it takes to make the whole thing work properly in all aspects would be a good idea. At this time, the conversion functions are monolithic and do not scale well at all.

In that respect, maybe we should have a "Version 2.x" issue and talk about the different features we'd want to have in the new version.

For instance, I think that the current settings are somewhat cumbersome to play with. Some are defined in the Taxonomy when they should be in the Terms. And the worst part at this time is the paging/caching. We should be able to work on a per page basis (i.e. 100 terms or less at a time.) There is a huge problem in that regard because we want to have a sort that the database cannot offer as is (it could do it, it just not going to happen!) So we'd need a cron system that adds terms to your cached list... That way, it would continue to be very fast and we could display exactly what we need.

And attempting to fix the existing version looks a bit of a waste of time if we are to get a new fantastic version. 8-)

Thank you.
Alexis Wilke

scotthoff’s picture

Writing a new version makes sense. I'm not sure how much help I would be. I'm using this module b/c I had not been able to figure out how to do it myself!

scotthoff’s picture

I might need to borrow a lot of your functions in any case.

I want to do the following:

I have a list of words and translations organized by category. I want the person to be able to select the language they are searching for (set as a CCK field) and then filter and show words that have that tag/term.

To get this functionality, I would need to hack your module and create a branch, start from scratch learning how you did it, or try to figure out how to make a module "add on" that makes mine work with yours.

Once the person selects a category, I would then output the term twice in the following format (Native Language - Foreign Language)

AlexisWilke’s picture

Hi Scott,

Yeah... it's a big project 8-)

The idea of theming is to use theme() to generate any output. In that case, you could very easily change the output of a term and add the foreign language to the native language. The theme() call could include the term identifier from which you could infer the translated term.

With the current version, it looks like an extremely difficult task though.

My idea is to use CRON so we can generate a list of ready-made entries instead of having to do all the parsing each time someone goes to a Taxonomy VTN page. What I've been thinking of is adding a table that gives us a way to query only the "few" terms we want to present on the page. Possibly with the output already themed (i.e. cached). So whenever you change the settings, modify or add a term, you mark that term out of date in the Taxonomy VTN list. That way you know you need to re-generate it on the next CRON. A CRON run can be limited to re-generating 100 terms maximum or something like that. That way, it does not take to much processing time. And we can have a button in the settings to let people regenerate manually.

The number of nodes attached to a term (which is very much time consuming to compute) would be calculated in the CRON function too (and again, only if the user wants the counts.) That would greatly decrease the time it takes to see the results. All of that data can be cached in the database.

There are problems with all the sorting capabilities... We'd have to make sure that we can use the database to properly sort. This includes sorting alphabetically or numerically. And with the proper SQL indexes, we should be able to retrieve only what we need from the database instead of the entire set of terms as is done today.

Thank you.
Alexis

scotthoff’s picture

Is creating a side table the best choice? I can see the point of what you are saying. However, there are some caching functionality out there already. (That I don't really know anything about).

The advantage if that would work would be to not create extra tables for the database...

I think you want to separate the presentation as much as you can from the theme so that people can change the ouptut.

AlexisWilke’s picture

scotthoff,

Some people have enormous taxonomies, like 600,000 terms. The current version breaks with that many terms and it generate one enormous page that even if cached is so large that it generates an enormous transfer each time it is accessed. In other words, the Taxonomy VTN cannot be used in such a case. With a cache that saves each term separately and pre-processed, now we can generate the table from the database cache instead of the the raw term information.

The cache we have right now is for the entire page which will be cached once the page successfully created.

For the cache we could use the cache defined by Drupal, but that would not allow us to search on fields properly... so our own table is the best bet.

Thank you.
Alexis

mxt’s picture

Subscribing.

I'd need configurable paging for taxonomy_vtn/alpha/xxx to break list of terms starting with the same letter in many pages.

Thank you very much.