How to add to href of image specific CLASS and REL for jquery fancybox?
Existing
<a href="path_to_file"><img src="thumbnail" /></a>
The goal
<a href="path_to_file" class="fancyx" rel="group1"><img src="thumbnail" /></a>
Jure
How to add to href of image specific CLASS and REL for jquery fancybox?
Existing
<a href="path_to_file"><img src="thumbnail" /></a>
The goal
<a href="path_to_file" class="fancyx" rel="group1"><img src="thumbnail" /></a>
Jure
No Universal solution fits all special business requirements. Our experienced team is ready with ideas and state-of-the-art technical solutions to consult the best solution within your budget.
Hi Jure,
Please describe where do you want to add this class
Hello
I want to add this to news article (node/100)
The complete code is bellow
<div class="field field-name-field-image field-type-image field-label-hidden">
<div class="field-items"><div class="field-item even">
<a href=" image "> image</a> ....
I already google the solution but classic aproach to modify modules/field/theme/field.tpl.php does not give me any change
It has to be some template specification, but I do not know which file.
You can copy field.tpl.php to md_visual/templates/ folder and change it to field--field-image.tpl.php, clear your site cache and edit your tpl files.
But I think you can use js (place this code on top of md_visual/js/script.js)
(function ($) {
Drupal.behaviors.md_visual = {
attach: function () {
$('.field-name-field-image a').addClass('fancyx').attr('rel','group1');
}
};
})(jQuery);
The field--field-image.tpl.php worked excelent.
Thank you for all the help