How Do I access files via Uploads in PyroCMS?

1.4k Views Asked by At

I've uploaded an image; random.png with PyroCMS through the admin and placed it into a folder called "Portfolio Images" (the url slug is 'portfolio-images')

In my pages I want to be able to reference this image using a tag. How does the url slug work? I've tried http://mysite.com/portfolio-images/random.png - but it doesn't work.

Is there a way to maybe reference it via the {{ asset:image }} tag?

Thanks!

1

There are 1 best solutions below

0
On

To display your image you can do :

there is a plugin for making file list the documentation is not yet available but you have a description of the plugin in the code in system/cms/modules/files/plugin.php

/**
 * Files listing
 *
 * Creates a list of files
 *
 * Usage:
 *
 * {{ files:listing folder="home-slider" type="i" fetch="subfolder|root" }}
 *  // your html logic
 * {{ /files:listing }}
 *
 * The tags that are available to use from this method are listed below
 *
 * {id}
 * {folder_id}
 * {user_id}
 * {type}
 * {name}
 * {filename}
 * {description}
 * {extension}
 * {mimetype}
 * {width}
 * {height}
 * {filesize}
 * {date_added}
 *
 * @return  array
 */