Announcement

Collapse
No announcement yet.

images in YahooSections list

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    images in YahooSections list

    Hi is it possible to use the YahooSections list with images? If you have a look at http://www.clintonenterprises.com/index.html what I want to do is keep the main list, but have a 2nd list with the team logos in the grey Colum below the checkout.

    I was thinking of just hard coding the logos in the page. What would you recommend?

    Thanks

    Wayne

    #2
    Hi Wayne,

    I guess you would need to tweak the existing code 'Yahoo-style section lists' in Advanced Users Guide to bring the images for the section lists. May be an advice from a JavaScript expert would be appropriate in this regard.

    Alternatively, hard-coding the section links with the images would be easier.
    Cheers,
    Suresh Babu G

    Comment


      #3
      Section images are available in the YahooSections code. Something like

      replace

      ar[i].sName

      with

      '<img src="' + ar[i].sImage + '" width="50">' + ar[i].sName

      and replace

      ar[i].pChild[j].sName

      with

      '<img src="' + ar[i].pChild[j].sImage + '" width="50">' + ar[i].pChild[j].sName

      would add an image before the section name.

      I've added a fixed width so that these will all be scaled to the same size.
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        Thanks Norman,

        That works great. I'm assumeing that this uses the image from the Section Detail.

        Is there a way to use a different image to the one Section Detail?

        Regards

        Wayne

        Comment


          #5
          Afraid not.

          However you could use a trick where you maintain a separate set of images with similar names to the Section ones but prefixed with (say) m-. Then tweak that JavaScript to use

          '<img src="m-' + ar[i].pChild[j].sImage + '" width="50">'

          And add these files into Advanced / Additional files so that Actinic will upload them for you.
          Norman - www.drillpine.biz
          Edinburgh, U K / Bitez, Turkey

          Comment


            #6
            Thanks Norman. Nice trick...that'll do me fine.

            Cheers

            Wayne

            Comment


              #7
              There may be some issues with Previewing as Actinic alters the image filename to point to the location of the image when Previewing and bunging a prefix onto it won't work.

              A better solution would be to suffix the images; e.g. sectionimg.jpg becomes sectionimage-m.jpg and amend the JavaScript above to

              '<img src="' + ar[i].pChild[j].sImage.replace(/\./,'-m.') + '" width="50">'

              Then keep these extra images in the same place as the normal section ones and all will be well.
              Norman - www.drillpine.biz
              Edinburgh, U K / Bitez, Turkey

              Comment


                #8
                Using an array of images for dynamic changing images

                Hi I was wondering whether it was possible to use the YahooSections function to return / echo a set of variables, which are picked up by a dynamic image changer such as the one on dyn-web..

                http://www.dyn-web.com/code/rotate_i...ate_random.php

                I have made a start with the variables, but I can't seem to get them to load into the dynamic image code from dyn-web. It would make a very nice feature to have a dynamically changing image that refers to the current section images.

                In <HEAD>

                Code:
                <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
                
                function YahooSections(ar)
                {
                var strIms = "[";
                var strUrls = "[";
                var stralt = "[";
                
                for (var i=1;i<=ar.length;i++)
                  {
                  if (ar[i].sURL != null)
                    {
                    strIms += '"' + ar[i].sImage + '"' + ',';
                    strUrls += '"' + ar[i].sURL + '"' + ',';
                    stralt += '"' + ar[i].sName + '"' + ',';
                		{
                      if (ar[i].pChild)
                        {
                        for (var j=1;j<=ar[i].pChild.length;j++)
                          {
                          if (ar[i].pChild[j].sURL != null)
                		{
                		strIms += '"' +ar[i].pChild[j].sImage + '"'+ ',';
                		strUrls += '"' + ar[i].pChild[j].sURL + '"' + ',';
                		stralt += '"' + ar[i].pChild[j].sName + '"' + ',';								{
                		if (ar[i].pChild[j].pChild)
                							{
                								for (var k=1;k<=ar[i].pChild[j].pChild.length;k++)
                								{
                									if (ar[i].pChild[j].pChild[k].sURL != null)
                										{	
                									strIms +=  '"' +ar[i].pChild[j].pChild[k].sImage + '"' + ',';			strUrls += '"' + ar[i].pChild[j].pChild[k].sURL + '"' + ',';			stralt += '"' + ar[i].pChild[j].pChild[k].sName + '"' + ',';
                								}
                							}	
                					
                					}
                				}
                          }
                        }
                      }
                }
                strIms += "]" ;
                strUrls += "]" ;
                stralt += "]" ;
                }
                }
                }
                var rotator1 = {
                    path: '/', 
                    speed:  3000, // default is 4500
                    id: 'r1',
                    bTrans: true,
                    bMouse: true,
                    bRand:  true,
                    images: return strIms
                    actions: return strUrls
                    title: return stralt
                
                	}
                
                function initRotator() {
                    dw_Rotator.setup(rotator1);
                }
                
                dw_Event.add( window, 'load', initRotator);
                
                </script>

                In <BODY>

                Code:
                <a href="index.html"><img id="r1" src="smile.gif" alt="" title="That's a nice smile!" border="0"></a>

                Is there a way of passing the variables using php??


                Please help

                Comment


                  #9
                  yahoo section lists are probably the worst thing for your sites speed and SEO imaginable.

                  try this instead:

                  http://community.actinic.com/showthr...=context+aware

                  though this wont help you with your image problem (not supported) you'll find that you sell more products due to better SEO.

                  Comment


                    #10
                    please ignore my last post, i assumed v8/9 when in fact, you're on v7.

                    Comment


                      #11
                      I completely agree, but is there a way of returning an array of section images, urls and names AND then code a dynamic changing image with these arrays?

                      I only suggested the YahooSections route because it's really easy to spit out the arrays - I just couldn't find a way of putting them back into the dyn-web code.

                      Comment


                        #12
                        perhaps I should start a new thread - the v7 thread was the closest I could find to what I wanted - ie. images in yahoosections,

                        I am however using v8 - so if there is an answer to my last post in 8 then I'd be really interested - YahooSections or Your PHP menu way I be happy with either!!

                        Comment

                        Working...
                        X