Hot answers tagged

11

Sure - first you need to track views in order to determine popularity. So on your "single entry" templates, add track_views="one" to your channel:entries tag. Then, you can use orderby="view_count_one" on your channel:entries listings tags.


6

Textbook use case for Stash: {exp:channel:entries channel="blog|news|press_releases" dynamic="no" limit="50" } {exp:stash:append_list name="entries" context="{channel_short_name}"} {stash:url_title}{url_title}{/stash:url_title} {stash:title}{title}{/stash:title} {/exp:stash:append_list} {/exp:channel:entries} <ul> {exp:stash:...


5

The start_on parameter uses the entry_date, not the custom date field you defined. To target the custom field, use the search: parameter. Also, you need to know how EE stores its date fields: as a Unix timestamp. Which just is a large number. With EE 2.7+, you can use Numeric matching, so you could use that too. search:my_custom_date_field=">={...


4

You can wrap channel:entries tag parameters in simple conditionals. So a conditional based on a segment variable will work. This is just an example since I'm not entirely sure I interpreted what you're after, but should give you an idea. {exp:channel:entries channel="news" limit="9" paginate="bottom" sort="desc" {if segment_3} ...


4

try to add sticky DESC {exp:query sql="SELECT entry_id AS rel_entry_id, title AS rel_title, (SELECT rel_child_id FROM exp_relationships WHERE rel_id = '{select-location}' LIMIT 1) AS rel_child_id FROM exp_channel_titles WHERE channel_id IN (5, 7) AND status='Open' ORDER BY sticky DESC, title ASC "}


3

You should use a date_heading. {exp:channel:entries [...]} {date_heading display="monthly"}{entry_date format="%F %Y"}{/date_heading} [...] {/exp:channel:entries} The value of the parameter "display" will set when the code on {date_heading} variable pair will be repeated. Please, forgive the simple code sample, but you don't gave more details.


3

Probably the order is the order in which the relationships were created; this at least would be the case for the native EE-relationships. I assume with playa it is the same. From the docs: Ordering by a Relationship field will cause entries to appear in the order the relationships were made, not based on any content from the related entries.


3

If by "Goal difference" you mean {goals_scored} - {goals_against}, you gonna have to write a custom query. With the Channel Module, the closer you can get is to sort both fields in different directions: {exp:channel:entries channel="ranking" orderby="points|goals_scored|goals_against" sort="desc|desc|asc"} {team} | {points} | {goals_scored} | {...


3

You're in custom plugin territory Travis. Pretty easy though. Run one (very quick) query to get the latest entry_id in each channel (query exp_channel_titles only). Save them all to an array. Then, you can either return those entry_ids as a variable (concatenated with |), which you pass to your channel:entries tag in your template, or instantiate a new ...


2

Stephen, simple conditionals are parsed before modules tags. Because of this, you can put them inside your opening channel:entries variables. I put more custom fields on this example to make it more clear. <ul> {exp:channel:entries channel="product" {if segment_3 == "price"} orderby="{cf_product_price}" {/if} {if segment_3 == "brand"...


2

Using Low Yearly Archives, you can do something like that: {exp:low_yearly_archives channel="blog" status="not closed" sort="desc" monthsort="desc"} {months} {if num_entries != 0} <h2>{month} {year}</h2> <ul> {embed="news/archives_month" y="{year}" m="{month_num_short}"} </ul> {/if} ...


2

If you were to output your Channel Video tag loop into a Stash list, using {stash:set_list}, then you could pull a random subset out via {stash:get_list orderby="random" limit="2"}. Here are links, for more info: Stash Set List and Stash Get List. There also are lots of Stash list examples here on the EE Stack Exchange.


2

If you can get the total number of returned results (say, 10 videos) you could probably use one of the two add-ons below to return a random number in that range for a {if count == "3"} conditional? http://devot-ee.com/add-ons/random-between or http://devot-ee.com/add-ons/low-random Just thinking outside the box with no experience with Channel Videos.


2

Strange that you're getting a random output since orderby="id" is the default. Are you sure there isn't some kind of JavaScript that's reordering your fields on the front-end? You could try disabling JavaScript to verify that. Otherwise you could try explicitly setting the id field as the orderby (which I've never had to do before). {homepage_sliders ...


2

I see this is missing in the Low Search Store docs, but try this: orderby="store:price".


2

You could enable php, grab the current time and add as much time as you need, then use the start_on parameter. Or here's a plugin you could use: http://devot-ee.com/add-ons/dt-plugin Maybe something like this as the start_on parameter: {exp:dt day="7" ee_format="true" format="%Y-%m-%d %H:%i"}


2

If you are only trying to display a single featured entry and if no featured then a single entry with the status of open. I'd do the this. Order your results by status and allow featured and open status entries and then sort it to to look for featured first then open. I think that might be sort="asc" So heres what your code will look like. {if ...


2

You can use the fixed_order="{embed:ids}" parameter. Documentation can be found here.


2

Sounds to me that the fixed_order parameter is exactly what you are looking for. Related: Expression Engine Entries Loop in Reverse


2

So it looks like I have to disable "Cache Dynamic Channel Queries?" in Admin->Channel Administration->Global Channel Preferences For random ordering to function properly


1

You can use the "orderby" parameter. {exp:channel_images:images entry_id='{entry_id}' orderby='image:id' sort='asc'} See: http://www.devdemon.com/documentation/tag/images/ UPDATE 1: If you want images in a specific order then you need to move them inside the entry into the order you want using the Move icon in the Actions column. NOTE: The cover image ...


1

I've been done this sometimes, but not using relationships. I believe the process is the same. Try to order the entries by both date and status. Each one in one direction. status="featured|open" orderby="status|date" sort="asc|desc" limit="1"


1

The short answer is that you cannot sort by channel natively. The long answer is that native search result ordering is determined by the search form itself so that the sorting can be done by the database when the search takes place. If an orderby field is present in the POST data, the sort can be customized with the following options: <select name="...


1

Another option if available in your build would be to use Stash. You could simply build a list containing the following for each ranking points team goals_scored goals_against goals_difference (which you could calculate using something like mx calculator You could then use multiple orders and sorts (amongst which the goals difference) when using {exp:stash:...


1

Try this: display_by="day" limit="30" EE-docs for display-by-parameter EDIT: It seems that the limit-parameter in the example above does NOT limit to 30 absolute days (and so will show entries from the last 30 days), but it will count days on which entries have been posted. So if you use limit="30" it will show all entries from the last 30 days on which ...


1

One way to do this would be to create a custom extension that uses the low_search_post_search hook. That will give you an array containing all parameters that will be passed through to the native channel:entries tag for parsing the results. That includes the entry_id or fixed_order parameter which contains the entry IDs for the search results (as long as a ...


1

EE can't show what it doesn't have. So the channel entries should not be the starting point of your quest, but i guess the timeslots should be. I would either go for a frontend solution and let jquery (or a library like angular/knockout) solve the display problem. Or i would prepare a timeslot-list with stash and add the entries to another list and/or ...


1

I'd use stash fo sure! The following is a guide and not a verbatim copy/paste solution. Theory is capture a list of the items you want to capture & display AND also capture the relevant date to use to display relevance. {exp:stash:set_list name="recent_news" parse_tags="yes"} {exp:channel_entries ...} {stash:entryid}{entry_id}{/stash:entryid} //...


1

Low has pointed out the why of your dilemma. There is one other solution you can consider; Solspace's date field filter, which allows you to remap the default date ordering functionality (which as Low points out is tied to the entry_date). This way, you can apply the "proper" ordering parameters for the entries loop, making your custom field the date to use....


1

Looks like the parameter should be "OrderBy" without the underscore. https://exp-resso.com/docs/orders_tag.html#orderby I also verified this in the code that it is indeed looking for the "OrderBy" parameter opposed to "Order_By" :D


Only top voted, non community-wiki answers of a minimum length are eligible