SitePoint Sponsor

User Tag List

Results 1 to 11 of 11

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    May 2010
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Red face list of links click one to go to related image in gallery (new page )

    i know my summary is not the clearest so here goes....

    the page www.philip
    -----
    dusel
    .com

    has several links to click ...all different images. they all link to the same page which is an image gallery. i would like for the new page to open with the related image enlarged in the gallery instead of always showing the first image in the list regardless of which link was clicked. i hope i am being clear.

    ps what is the standard way of providing a link yet hiding it from the crawling robots?

    thanks so much for your help

  2. #2
    Non-Member
    Join Date
    Apr 2011
    Location
    no fixed address
    Posts
    851
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by phillycheese123 View Post
    ...... i would like for the new page to open with the related image enlarged in the gallery instead of always showing the first image in the list regardless of which link was clicked........
    I assume your image gallery has a function to which a parameter is passed telling it to enlarge the image identified by the parameter.

    In that case, the url in the image links href should contain a query string with the appropriate parameter from above attached to it. Then when the new page opens, it passes the parameter in the query string to the above function in order to display an enlargement of the selected image on page load.

  3. #3
    SitePoint Enthusiast mattgoffrey's Avatar
    Join Date
    Nov 2011
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by phillycheese123 View Post
    ps what is the standard way of providing a link yet hiding it from the crawling robots?
    Since webdev already hit the first part of your question, I'll hit your PS ...

    rel=nofollow

    Add that inside your anchor tag

  4. #4
    SitePoint Enthusiast
    Join Date
    May 2010
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It sounds like u know what you're talking about
    click on some of but if you could visit thepage and click on some of the images
    Just so im sure we r on the same page.
    My image gallery (Molly.html) uses img ids . going through the images does not change the url. so how would i add the img ids to the hrefs (on the 1st page)
    I feel like im having trouble explaining well or understanding...can you give me a code snippet showing how i would add the imo ids to the href on the first page. it would be clear to me if with each image on Molly.html the url changed but since it does not change im really not sure.

    thanks for your time

  5. #5
    SitePoint Enthusiast
    Join Date
    May 2010
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    this is my best guess

    <a href="http://www.philipdusel.com/images/window1.jpg id="img1"><img alt="" src="http://www.philipdusel.com/images/window2.jpg" width="280" height="300" border="0" /></a>


    how can i add the specific parameters of the image if the url has no image extention....it stays at molly.html no matter which image is viewed.

    i never got a response to my reply...i do appreciate your help and trust me ive tried to figure this out on my own.

    thanks so much

    <a href="<a class="sublink" href="http://www.sitepoint.com"></a>" rel="nofollow">my page linking to image gallery</a>

    ps i tried the rel="nofollow" above but cant seem to make that hide my name

    thanks

  6. #6
    Non-Member
    Join Date
    Apr 2011
    Location
    no fixed address
    Posts
    851
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In your philip.dusel.com page you could have images set up as links with something like this


    Code HTML4Strict:
    <a href="molly.htm?img1">
           <img src="img1.jpg" alt="" />
    </a>
     
    <a href="molly.htm?img2">
           <img src="img2.jpg" alt="" />
    </a>

    Since you are passing only 1 parameter in the href's query string just the value of the parameter will suffice. You don' need to give it a name.

    If img1.jpg is clicked then in molly.htm the query string ?img1 will be in the search property of the Location object. Just strip out the ? to get the image id (img1). Then pass the image id to the function you have to enlarge an image in molly.htm.

  7. #7
    SitePoint Enthusiast
    Join Date
    May 2010
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    not quite sure about what you mean by swapping the ?

    <a href="molly.htm?img1"> -------this goes to a page that doesnt exist
    <img src="img1.jpg" alt="" /> ------this can be called whatever right?------
    </a>



    even though on molly.html there is an image with the id="img1" putting an href in my index pointing to "molly.htm?img1" doesnt do anything
    should it be molly.html/img1 -------that didnt work

    thanks



    If img1.jpg is clicked then in molly.htm the query string ?img1 will be in the search property of the Location object. Just strip out the ? to get the image id (img1). Then pass the image id to the function you have to enlarge an image in molly.htm.
    ***************

  8. #8
    Non-Member
    Join Date
    Apr 2011
    Location
    no fixed address
    Posts
    851
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by phillycheese123 View Post
    <a href="molly.htm?img1"> -------this goes to a page that doesnt exist
    Then what happened to molly.htm where you said

    Quote Originally Posted by phillycheese123
    My image gallery (Molly.html) uses img ids....
    and how does it relate to the web page url you posted in your first post?

    In any case what I posted is a demo of the process with an explanation of my suggestion. It's not the actual coding solution for your particular situation because I haven't got your actual code.

    I told you in my original post what I was assuming in my reply. You haven't said if my assumption is correct or not.

  9. #9
    SitePoint Enthusiast
    Join Date
    May 2010
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sorry i thought you had visited my site

    i dont mean to be so confusing but i am confused

    i added the code




    <a href="molly.htm?img1">
    <img src="img1.jpg" alt="" />
    </a>


    it does not bring up img 1 on the page molly.html instead it gets a 404 error

    when i cycle through the images in the image gallery on molly.html the url does not change with the images being changed. it stays at molly.html ....with no extenstions such as molly.htm?img1

    can you check it out if im not being clear?

    thanks for your time

  10. #10
    Non-Member
    Join Date
    Apr 2011
    Location
    no fixed address
    Posts
    851
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by phillycheese123 View Post
    i added the code

    Code:
    <a href="molly.htm?img1">
           <img src="img1.jpg" alt="" />
    </a>
    it does not bring up img 1 on the page molly.html instead it gets a 404 error
    That's because img1.jpg is just a sample file name for demo purposes as I stated in my last post

    In any case what I posted is a demo of the process with an explanation of my suggestion. It's not the actual coding solution for your particular situation because I haven't got your actual code.

    I told you in my original post what I was assuming in my reply. You haven't said if my assumption is correct or not.
    You need to use the file names of your actual image files.

    With you not realisng that, it appears to me either you didn't write the code on your website and you are looking for someone to fix it for you or you have bitten off way more than you can chew - I'm not sure which.

    In any case, I don't have the time (well not for free at least) to go through your code and fix it to do what you want.

    Your options are either wait for someone else to come long here or elsewhere to help you or hire a professional web developer to fix the code for you.

  11. #11
    SitePoint Enthusiast
    Join Date
    May 2010
    Posts
    84
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sorry to have wasted your time. of course i really have not much of an idea of what i am doing


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •