graker / oc-photoalbums-plugin Goto Github PK
View Code? Open in Web Editor NEWPhoto albums plugin for OctoberCMS
License: MIT License
Photo albums plugin for OctoberCMS
License: MIT License
Thanks for very nice plugin.
An exception has been thrown during the rendering of a template ("SQLSTATE[HY000]: General error: 1 no such function: RAND (SQL: select * from "graker_photoalbums_photos" order by RAND() asc limit 5)").
When using RandomPhotos Component on SQLite.
For MySQL 5.7 the plugin conflict with default on sql_mode only_full_group_by
SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column '*****.graker_photoalbums_photos.sort_order' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by (SQL: select album_id, count() as aggregate from
graker_photoalbums_photos
wheregraker_photoalbums_photos
.album_id
in (1) group byalbum_id
order bysort_order
asc)
`
Is there a way to randomize photos within an album when selecting an album?
Hello graker, is it possible to use pagination on your plugin? How to do that, if its possible? Pls give me a tutoruial.. Thanks
How does one access components like slugs, albums, photos (under "Documentation") using HTML or PHP?
It doesn't seem like the syntax for markdown will work and not sure how to use SELF in this context?
EDIT: I basically want to be able to retrieve a list of the albums, open particular albums, and get lists of the photos in that album by url. Is that possible here?
Thanks!
Hi Graker,
Wanted to know if there is a way to output all the albums with all the photos in it. Currently I can only output list of Albums and one complete album set at a time using its slug (I could add this component multiple times with individuals album slug but this wont scale once you have large number of albums).
Thanks
Hi Graker,
I am using your plugin to show photos on page. In most I care about photos pagination.
Everything works fine but I have a little problem with pagination.
I have got page /albums/:slug
and on this page just added album component like this:
{% set album = photoAlbum.album %}
<h1>{{ album.title }}</h1>
{% if album.description %}
<div class="album-description row">
<div class="col-xs-12">
{{ album.description|raw }}
</div>
</div>
{% endif %}
<div class="album-photos row">
{% for photo in album.photos %}
<div class="photo col-xs-12 col-sm-6 col-md-4 col-lg-3">
<a href="{{ photo.url }}"><img
data-src="{{ photo.thumb }}"
src="{{ photo.thumb }}"
alt="{{ photo.title }}"
title="{{ photo.title }}"
style="max-width: 100%" />
</a>
<a href="{{ photo.url }}"><strong>{{ photo.title }}</strong></a>
</div>
{% else %}
<div class="col-xs-12 no-data">Album doesn't have any photos yet</div>
{% endfor %}
</div>
{% if photoAlbum.lastPage > 1 %}
<ul class="pagination">
{% if photoAlbum.currentPage > 1 %}
<li><a href="{{ this.page.baseFileName|page }}?page={{ photoAlbum.currentPage-1 }}">← Prev</a></li>
{% endif %}
{% for page in 1..photoAlbum.lastPage %}
<li class="{{ photoAlbum.currentPage == page ? 'active' : null }}">
<a href="{{ this.page.baseFileName|page }}?page={{ page }}">{{ page }}</a>
</li>
{% endfor %}
{% if photoAlbum.lastPage > photoAlbum.currentPage %}
<li><a href="{{ this.page.baseFileName|page }}?page={{ photoAlbum.currentPage+1 }}">Next →</a></li>
{% endif %}
</ul>
{% endif %}
I set photos on page to be 8. In the fragment "menu" I added albumList component to display all galleries in the dropdown submenu.
<ul class="submenu">
{% for album in albumList.albums %}
<li>
<a href="albums/{{album.slug}}">{{ album.title|raw }}</a>
</li>
{% endfor %}
</ul>
It works perfectly but when I goes e.g. to /albums/myphotos?page=2
, dropdown submenu is empty. It doesn't work even when I use other plugin e.g. rainlab blog to display list of albums. When I goes to /albums/myphotos?page=1
or just /albums/myphotos
dropdown submenu shows albums.
The same situation when I want to add prev - next navigation in single album page.
{% set portfolios = albumList.albums %}
{% for portfolio in portfolios %}{% if this.param.slug == portfolio.slug %}
<div class="wrapper">
<ul class="single-pagination">
{% if not loop.first %}
<li class="prev"><a href="{{'portfolio'|page}}/{{portfolios[loop.index0-1].slug}}"><img src="{{portfolios[loop.index0-1].latestPhoto.thumb}}" alt="prev"><span> {{portfolios[loop.index0-1].title}}</span></a></li>
{% endif %}
<li class="backtoworks"><a href="{{'portfolio'|page}}">Albums</a></li>
{% if not loop.last %}
<li class="next"><a href="{{'portfolio'|page}}/{{portfolios[loop.index0+1].slug}}"><img src="{{portfolios[loop.index0+1].latestPhoto.thumb}}" alt="next"><span> {{portfolios[loop.index0+1].title}}</span></a></li>
{% endif %}
</ul>
</div>
{% endif %}
{% endfor %}
When I add two components Album
and Album list
on the same page, photos pagination doesn't work. When I add partial to /albums
page with above code, on ?page=2
prev - next navigation disappears, on ?page=1
or just /albums/myphotos
its visible.
I don't know if it's a problem or I'm doing something wrong?
Hi there,
I have extended your plugin by adding some custom fields to photo model. This works and I can successfully added my details to the fields however, these fields are not visible when I try to edit the photo from photo list present in the album.
can you guys help me how can I extend the view of the added fields in Albums too.
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.