-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added docs on how to use Photologue.
- Loading branch information
Richard Barran
committed
Mar 18, 2019
1 parent
d881797
commit fe8817f
Showing
3 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
##### | ||
Usage | ||
##### | ||
|
||
Now that you've installed Photologue, here are a few suggestions on how to use it: | ||
|
||
Upload some photos in the admin | ||
------------------------------- | ||
The ``Photo`` model in the admin allows you to add new photos to Photologue. You can add photos one by one - and | ||
it the top-right corner there is a 'Upload a Zip archive' button that will allow you to upload many photos at once. | ||
|
||
Define some Photosizes | ||
---------------------- | ||
Photologue will create thumbnails of the photos that you upload, and the thumbnails are what is displayed in the | ||
public website. By default Photologue comes with a few Photosizes to get you started - feel free to tweak them, or | ||
to create new ones. | ||
|
||
Just note that the ``admin_thumbnail`` size is used by the admin pages, so it's not a good idea to delete it! | ||
|
||
Built-in pages and templates | ||
---------------------------- | ||
|
||
If you've followed all the instructions in the installation page, you will have included Photologue's | ||
urls at ``/photologue/`` - you can use these, tweak them, or discard them if they do not fit in with your website's | ||
requirements. | ||
|
||
Custom usage | ||
------------ | ||
The base of Photologue is the ``Photo`` model. When an instance is created, we automatically add methods to retrieve | ||
photos at various photosizes. E.g. if you have an instance of ``Photo`` called ``photo``, then the | ||
following methods will have been added automatically:: | ||
|
||
photo.get_thumbnail_url() | ||
photo.get_display_url() | ||
photo.get_admin_thumbnail_url() | ||
|
||
These can be used in a custom template to display a thumbnail, e.g.:: | ||
|
||
<a href="{{ photo.image.url }}"> | ||
<img src="{{ photo.get_display_url }}" alt="{{ photo.title }}"> | ||
</a> | ||
|
||
This will display an image, sized to the dimensions specified in the Photosize ``display``, | ||
and provide a clickable link to the raw image. Please refer to the example templates for ideas on how to use | ||
``Photo`` and ``Gallery`` instances! |