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

Ordering weblog entries

Development and Programming

Michael Hay's avatar
Michael Hay
65 posts
16 years ago
Michael Hay's avatar Michael Hay

I wonder if anyone has any ideas that would help me solve this problem:

We want to be able to order our weblog entries by a custom order per category. For example when viewing categoryA we might want to view entry1, entry2, entry3. And when viewing categoryB we might want entry2, entry1, entry3.

Currently we achieve our custom ordering by using a custom field called “order” which takes a number. Then in the weblog entries tag we use

orderby="order" sort="asc"

The obvious choice seems to be the category_posts table. My extension could add another column in here, then I create a nice little ordering gui in the control panel and hey presto.

Question is, what’s the best way to hooking into the weblog entries tag to allow me to read data from this table? I don’t want to make any extra database calls for each weblog entries call for performance reasons.

The other option I was thinking of is having a custom field in each weblog entry which holds the order value for all categories it is a member of. Something like

cat1=4|cat2=3|cat5=1

Then on the front end I could use a hook to split up the string and reorder the weblog entries according to the selected category.

The weblog_entries_query_result hook looks promising, however I’m running eev1.6.4 and this hook didn’t come into force until 1.6.7. Upgrading would be a tough sell to the bosses for fear it would break something.

Any ideas/contributions would be welcome.

       
Michael Hay's avatar
Michael Hay
65 posts
16 years ago
Michael Hay's avatar Michael Hay

Does anyone have any suggestions for this?

       

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.