Author Topic: cat_name in image's "ALT" field  (Read 10613 times)

0 Members and 1 Guest are viewing this topic.

Offline k1lljoy

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • Razruha.Ru
cat_name in image's "ALT" field
« on: November 11, 2009, 12:07:21 AM »
Hi!  :)
Is it possible to put the name of the caregory the image was uploaded to - into the ALT filed of that image, together with the name of that image?
Just adding {cat_name} beside the existing {image_name} in media templates (templates/media/jpg.html) doesn't make anything - the category name doesn't appear in the ALT-field  :oops:
Help please  :roll:


Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: cat_name in image's "ALT" field
« Reply #1 on: November 11, 2009, 02:46:00 PM »
{cat_name} should work...
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Hagen-Roderich

  • Full Member
  • ***
  • Posts: 127
    • View Profile
    • Hof Jokers
Re: cat_name in image's "ALT" field
« Reply #2 on: November 11, 2009, 04:26:50 PM »
I have followed on my site the first 2 points of this tip: http://www.4homepages.de/forum/index.php?topic=25442.msg139561#msg139561
Just replace "{image_description}" with "{cat_name}" and change the "jpg.html" as you want.

Offline k1lljoy

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • Razruha.Ru
Re: cat_name in image's "ALT" field
« Reply #3 on: November 11, 2009, 08:46:51 PM »
Hagen-Roderich  - thanx, that worked for my thumbs all right, bt still problems with the images themselves :(
 V@no  - I also thought it should work, but...  :|

Well, in my /templates/default/media/jpg.html
 I put the following:

Code: [Select]
<img src="{media_src}" border="1" alt="{cat_name} - {image_name}"{width_height} />
But I get just  " - image name" Alt now.

But I`ve noticed, that if I change the sequense of code snippets here:  
Code: [Select]
 "image" => get_media_code($image_row['image_media_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $image_row['cat_name'], $mode, $show_link, $detailed_view),(in includes/functions.php)
lke that:
Code: [Select]
 "image" => get_media_code($image_row['image_media_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['cat_name'], $image_row['image_name'], $mode, $show_link, $detailed_view),
then I get just category name in my ALT  :D
for example: "category name - " , that is without the name of the image already...

Is it possible to have both of them ?  :roll:


ADDED: solved!  :)
Just needed to add       "cat_name" => $cat_name,
to the:     $site_template->register_vars(array(
list  :o
« Last Edit: November 11, 2009, 09:29:54 PM by k1lljoy »


WilliamRU

  • Guest
Отдых
« Reply #4 on: October 24, 2011, 07:16:55 PM »
Полностью разделяю Ваше мнение. В этом что-то есть и мне нравится Ваша идея. Предлагаю вынести на общее обсуждение.