WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • how add image to link by page id
  • Print
Pages: [1]   Go Down

Author Topic: how add image to link by page id  (Read 8619 times)

nps

  • Guest
how add image to link by page id
« on: February 21, 2010, 03:12:35 AM »
My code

$image_arr = array(
55 => '/media/gallerys/kelione-i-ventes-raga/thumb/kelione-i-ventes-raga-026.jpg',
56 => '/media/gallerys/kelione-i-ventes-raga/thumb/kelione-i-ventes-raga-023.jpg'
);


show_menu2(0, SM2_CURR+1, SM2_CURR+2, 0,  '<div class="image_title"> <div class="imagep">
    [a]<img src="'.$image_arr[55].'" alt="" border="0" width="230" height="130" />[/a]
 </div>[menu_title]</div>');

how add image from array 'image_arr' in show_menu2? (55 and 56 is pages id)
Logged

Offline BerndJM

  • Posts: 1764
  • Gender: Male
Re: how add image to link by page id
« Reply #1 on: February 21, 2010, 05:01:23 AM »
Hi,

if you have a closer look to the SM2 documentation (to find in the modules directory) you will see in the section
"FORMAT STRINGS"
the following:
Quote
[page_id]       Page ID of the current menu item

Regards Bernd
Logged
In theory, there is no difference between theory and practice. But, in practice, there is.

nps

  • Guest
Re: how add image to link by page id
« Reply #2 on: February 21, 2010, 02:35:24 PM »
Yes, i'm found about page_id, but $image_arr is php. Try but not wirked with [page_id]. Try php variable $page_id but show parent menu id.
Logged

Offline sky writer

  • Posts: 926
Re: how add image to link by page id
« Reply #3 on: June 19, 2011, 07:02:22 PM »
I am very interested in this functionality.  Were you ever able to get the results you were after?
Logged

Offline DarkViper

  • Forum administrator
  • *****
  • Posts: 3087
  • Gender: Female
Re: how add image to link by page id
« Reply #4 on: June 20, 2011, 12:17:51 AM »
a easy, but not the cleanest way::

save files like:
/wb/media/gallerys/kelione-i-ventes-raga/thumb/kelione-i-ventes-raga-55.jpg
/wb/media/gallerys/kelione-i-ventes-raga/thumb/kelione-i-ventes-raga-56.jpg

then use
Code: [Select]
<?php
show_menu2
(0, SM2_CURR+1, SM2_CURR+2, 0,  &#39;<div class="image_title"> <div class="imagep">
    
[a]<img src="/wb/media/gallerys/kelione-i-ventes-raga/thumb/kelione-i-ventes-raga-[page_id].jpg" alt="" border="0" width="230" height="130" />[/a]
 </
div>[menu_title]</div>&#39;);
?>
Logged
Der blaue Planet - er ist nicht unser Eigentum - wir haben ihn nur von unseren Nachkommen geliehen

"We need education to cope with digitalization - and NOT the digitalization of education.!"

Tägliches Stoßgebet: Oh Herr, wirf Hirn vom Himmel !

Offline sky writer

  • Posts: 926
Re: how add image to link by page id
« Reply #5 on: June 20, 2011, 06:00:09 AM »
Very nice.  How would I go about making this a horizontal menu.  I've styled as I've done with other horizontal menus I use, but the internal div's seem to be breaking things.  If I take out the internal div's and put just one div outside the show_menu code, then it works horizontally.  But the menu title appears to the right of the image, instead of below, which is what I want.

Any direction would be greatly appreciated.
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • how add image to link by page id
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2