4images Forum & Community
Welcome, Guest. Please login or register.
Did you miss your activation email?
June 23, 2018, 02:19:30 AM

Login with username, password and session length
Search:     Advanced search
Togle to toolbar
Translate this page with =>
Translate this page >
* Home Help Search Login Register
 
+  4images Forum & Community
|-+  4images Issues / Ausgaben
| |-+  Discussion & Troubleshooting (Moderators: Acidgod, ivan, Rembrandt)
| | |-+  cat_name in image's "ALT" field
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: cat_name in image's "ALT" field  (Read 9273 times)
k1lljoy
Jr. Member
**
Offline Offline

Posts: 79

Thank You
-Given: 2
-Receive: 0


View Profile WWW
« on: November 11, 2009, 12:07:21 AM »

Hi!  Smile
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  Embarassed
Help please  Rolling Eyes
Logged


V@no
If you don't tell me what to do, I won't tell you where you should go :)
Administrator
4images Guru
*****
Offline Offline

Posts: 17849

Thank You
-Given: 47
-Receive: 576

mmm PHP...


View Profile WWW
« Reply #1 on: November 11, 2009, 02:46:00 PM »

{cat_name} should work...
Logged

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)
Hagen-Roderich
Full Member
***
Offline Offline

Posts: 127

Thank You
-Given: 18
-Receive: 10


View Profile WWW
« 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.
Logged

k1lljoy
Jr. Member
**
Offline Offline

Posts: 79

Thank You
-Given: 2
-Receive: 0


View Profile WWW
« 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 Sad
 V@no  - I also thought it should work, but...  Neutral

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

1
<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:  
1
 "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:
1
 "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  Very Happy
for example: "category name - " , that is without the name of the image already...

Is it possible to have both of them ?  Rolling Eyes


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


WilliamRU
Guest
« Reply #4 on: October 24, 2011, 07:16:55 PM »

. - . .
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.19 seconds with 19 queries.
Post your comments here