We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Photo Gallery categories order

Development and Programming

webnology's avatar
webnology
353 posts
16 years ago
webnology's avatar webnology

Hi all,

can’t seem to get the ctageoy ordering working.

I need sth like this, but I can’t find where the correct syntax to do this.

{exp:gallery:categories gallery="{gallery_name}" orderby="date" sort="asc"}

Can anyone help me please?

Thx, M

       
webnology's avatar
webnology
353 posts
16 years ago
webnology's avatar webnology

Hi,

just reminding this thread, to see if someone knows how to do this?

Thx, M

       
cbridgew's avatar
cbridgew
16 posts
16 years ago
cbridgew's avatar cbridgew

This thread probably should have been in How to or one of the general help forums.

However

I use orderby=”entry_date”. Is your orderby pointing to the correct field name?

Sorry I am not one of the EE Guru’s here.

       
webnology's avatar
webnology
353 posts
16 years ago
webnology's avatar webnology

Hi,

that type of ordering doesn’t seem to change anything in the gallery. I’vre tried several things, but all stay the same.

M

       
cbridgew's avatar
cbridgew
16 posts
16 years ago
cbridgew's avatar cbridgew
Hi, that type of ordering doesn’t seem to change anything in the gallery. I’vre tried several things, but all stay the same. M

I checked my photo gallery setup to see what I had that I know worked

{exp:gallery:entries gallery="{gallery_name}"  orderby="title" sort="asc" columns="4" rows="10"}

You have to ensure the gallery_name variable is populated

I have this in the first line of the categories template

{assign_variable:gallery_name="Picturealbum"}

to show you that my template is working here is the gallery

http://www.ussalgolaka54.org/index.php/Agolpictures/category/

I am not doing all of the fancy things others are doing here.

       
webnology's avatar
webnology
353 posts
16 years ago
webnology's avatar webnology

Thx, but you are refering to the display of the pictures. I’m talking about the list of categories. Any idea how that can be sorted (In the CP we have Alphabetical and custom, but I’d like it to be sorted on entry date).

       
cbridgew's avatar
cbridgew
16 posts
16 years ago
cbridgew's avatar cbridgew

Sorry, I misunderstood your intent.

Are you looking to have it sort by date so you can list categories with newest items at the bottom since you indicated ASC as the sort order?

       
webnology's avatar
webnology
353 posts
16 years ago
webnology's avatar webnology

exactly, newest categories should be at the top, but asc nor desc work.

       
cbridgew's avatar
cbridgew
16 posts
16 years ago
cbridgew's avatar cbridgew

I spent a bit researching this last night and I am not sure you are going to be able do this with EE directly. I don’t think EE has this ability on categories. You may have to use SQL to build in this manner since I believe the sorting only works on the category information which is the name and description. It appears the date information is pulled from the pictures table

I would advise you to ask this information in the How do I area as you may get more response.

I do apologize I was not able to assist you in this.

       
Geoff Towle's avatar
Geoff Towle
330 posts
15 years ago
Geoff Towle's avatar Geoff Towle

For anyone else who may stumble across this thread, I used the following query to get the categories to display in the order they are listed in the CP:

{exp:query sql="SELECT cat_id FROM exp_gallery_categories WHERE gallery_id= '1' ORDER BY cat_order;" }
       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.