By rhip on
Hi
I have set up the recipe module on my website: http://www.teachvegetarian.com/?q=node/55
I would like to change the work 'Yield' to the word 'portions'.
Do you know how I might go about this? I had a trawl through the database but to no avail.
Many Thanks
Comments
Using jQuery
One method would be to use jQuery when the page loads to replace the word. The code would look something like this:
That would work...
but it would require the user running JavaScript which we can't always count on. OTOH, if they aren't it would just "gracefully" degrade to the current output, so I guess it's up to the OP to determine whether the potential for different output on different machines is acceptable for that part.
See you at the Drupalcon!
The easy way...
... though perhaps not the best way (since you'd have to make the edit to future updates to the module, too), would be to open the recipe.module file in a text editor and edit the offending line(s). ;-)
I believe the use of "Yield" you are looking for is on line 202 (and 1178?). Otherwise you could spend a bit more time using more "future-proof" methods to work with the "views" or create your own version of the node-recipe.tpl.php file and figure out how to put together your own output, but that would take a bit more time if that's the only thing you want to change. You might also want to change it on line 212 "Yield Units". Just DON'T do a blind "search and replace" of "yield" to "portion" or you'll likely break the module.
If you create a "patch", you could probably apply that to future versions of the module, but that requires some code management that might be a bit more trouble than you're ready to take on right now?
See you at the Drupalcon!
That worked perfectly
Thank you LoMo
I will make a note to change it everytime I upgrade.
That is awesome.
Glad you've got it sorted...
The solution I provided was admittedly "hackish" since you will need to make the change whenever the module is updated, but if that's not too frequent and that's the only change you wanted to make... and your Drupal tech skills aren't well honed yet, it's probably the simplest solution for a "quick fix". Later, after you've learned more about how it all works and have more time to mess with custom views/templates, etc, you can produce something that should be a bit more "future-proof" and be a better fit to "best practices".
Anyway, glad you got it working well for you. :-)
See you at the Drupalcon!
Thanks
Yes, I agree! I hope to have more time to do a proper job soon.
Thanks again