Hot answers tagged

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} ...


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} | {...


2

One way to do this. You add a grid field for the heading value, then when you input data ensure that field is only present in the first row of a group. The template code would then go something like this: Lets say your grid name is sport_grid, and the grid has two field, grid_heading and grid_item {sport_grid} {if sport_grid:sport_heading}<h1>{...


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

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


2

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


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 ...


1

I cannot replicate your results. Created a new channel "test" with a single field "counter" set to Text with field entry set to "integer". Built template with this code: <h1>Sorting Test</h1> <h2>Sort with orderby="entry_id" sort="asc"</h2> <ul> {exp:channel:entries channel="test" orderby="entry_id" sort="asc"} <li>...


1

I think the Custom field sort_order may have value in string format. That's why it is not working.You need to convert it into integer format then try with it. You can convert it by making small pi.plugin_name.php and wrirting code to convert string to integer. Then place your {exp:plugin_name} code in orderby parameter of Channel entries loop. I hope above ...


1

It looks like you have some "sticky" entries, as per the Docs please try adding sticky="no" to you channel entries tag and see if that corrects things... Otherwise please also supply details of if any of these entries have different statuses or future/past posting dates, as the debugging will get a bit more difficult!


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

I don't think there will be a way to do it without a custom query. Something along the lines of: SELECT entry_id FROM exp_store_stock WHERE track_stock = '1' ORDER BY stock_level DESC One quick and easy way to use a custom query in place of a channel:entries tag is to use the Channel Query module. This template code works and should be a good starting ...


1

You could achieve this with Low Search, the Field Search filter and enabling smart_field_search. That will apply the search:field parameters only to the channels the field is assigned to. {exp:low_search:results channel="aprod|bprod|cprod" search:a_wn="=YES" search:b_wn="=YES" search:c_wn="=YES" smart_field_search="yes" }


1

Without going to a custom query you could try one master exp:channel:entries tag like: {exp:channel:entries channel="fprod|brod|drod|etc" disable="category_fields|member_data|pagination|trackbacks" dynamic="no" orderby="entry_date"} {if f_wn == "YES"} Product title, thumbnail, category (brand), etc. {/if} {if p_wn == "YES"} Product title, thumbnail, ...


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

Instead of sorting based on the contents of the TD, it would probably be better to set a data attribute to that TD and sort by that value. So instead of... <td>2 Authors<br>Joe Bloggs<br>Bloggsy Malone</td> You would want <td data-primary_author="Joe Bloggs">2 Authors<br>Joe Bloggs<br>Bloggsy Malone</td> ...


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

Try next code: {exp:channel:entries channel="filme" orderby="title" sort="asc" dynamic="off" limit="1000"} <?php mb_internal_encoding ("utf-8"); $letter = mb_strtoupper((mb_substr('{title}', 0, 1))); if (!in_array($letter, $temp)) { echo "<a href='$letter'>".$letter."</a>"; $temp[] = $letter; } ?> {/exp:channel:entries}


1

You could use the in-built 'sticky' option for an entry. All your sticky entries will appear first, regardless of your other orderby parameter values. More information on the EE docs: http://ellislab.com/expressionengine/user-guide/cp/content/publish.html#make-entry-sticky


1

You can't order your Super Search results by a function of another fieldtype like that. But wehat you can do is write a custom extension and then use the super_search_prep_order extension hook. The Rating module uses this hook to sniff for an order directive like order=rating. When it sees that, it runs its own routine to order the list of known entry ID'...


1

{exp:channel:next_entry channel="blog"} <a class="newer" href="{path=blog}"><span>Newer</span></a> {/exp:channel:next_entry} {exp:channel:prev_entry channel="blog"} <a class="older" href="{path=blog}"><span>Older</span></a> {/exp:channel:prev_entry}


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