Jump to:

23483 Posts in 18976 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » how to add URL links to images

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1477 Views
  • oldwrinkly
    Community Member
    34 Posts

    how to add URL links to images Link to this post

    Using my localhost test site,
    I have created a `sharepage` to link photos to forums, or friends to download,
    I have used this code to show the images........

    function FilesToDisplay() {
    $dir = DataObject::get_one('Folder', "Filename='assets/ImageShare/'");
    if ( $dir ) {
    return DataObject::get('Image', "ParentID='$dir->ID'");

    return null;

    in template..............

    <% control FilesToDisplay %>
    <% end_control %>

    This shows the images but the link it creates ie: http://localhost/silverstripe/ mysite/assets/ share/photo.jpg/

    produces a `page not found`in a browser

    I am stuck, can anyone help please

    I really wanted a list of URL`s beside a thumbnail, I have tried several different dataobject codes but to no avail


Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.