Hot answers tagged

11

You can include the author's name and a link using the author and author_id variables. For example: {exp:channel:entries channel="blog"} <h2>{title}</h2> {body} <p>Posted by <a href="/blog/author/{author_id}">{author}</a></p> {/exp:channel:entries} Then, at its most basic, create a template to display posts ...


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.


9

Use the built-in Stats module: {exp:stats channel="products"}{total_entries}{/exp:stats} Or the Query module: {exp:query sql="SELECT total_entries FROM exp_channels WHERE channel_name = 'products'"} {total_entries} {/exp:query} http://ellislab.com/expressionengine/user-guide/modules/statistics/index.html#total-entries


7

From performance view is better to use query for this: {exp:query sql="SELECT count(*) as total_results FROM exmx_channel_titles WHERE channel_id = '2' "} total results: {total_results} {/exp:query}


5

Now that ExpressionEngine includes a modulus operator (as of 2.7.1), you can also use that instead of switch if you prefer. Put the first html block's opening tag and the final block's closing tag outside of channel:entries and use modulus to conditionally close and re-open blocks of html: <div class="item-container active"> {exp:...


5

There is no direct way. I suggest you to install this module Edit If incase you have values to pass with comma separated (i.e., 5,00,000.05), You need to edit pi.math.php file to add this code on line number 54. // remove commas $formula = str_replace("," , "" , $formula);


4

Within the channel entry API, you can pass the data array containing the array of category ids like: ee()->load->library('api'); ee()->api->instantiate('channel_entries'); ee()->api->instantiate('channel_fields'); $data = array( 'title' => 'ENTRY TITLE', 'entry_date' => time(), 'channel_id' => x, '...


4

ExpressionEngine natively processes forms in secure mode which means each for submission is tied to an automatically generated XID / Hash which is passed as a hidden field in all CP and most front-end forms. The XID is a hash containing a reference to a database entry which gives EE a bunch of info about the user (their user agent, timestamp created, ip ...


4

You might could do something like this (php must be enabled on input) <?php $entries = array(); $sql = "SELECT author_id as author, max(entry_id) as entry_id FROM exp_channel_titles WHERE channel_id = '4' AND status = 'open' GROUP BY author ORDER BY entry_id DESC LIMIT 10"; $...


3

Try appending this &perpage=1000


3

switch can help in this case: <div class="item-container active"> {exp:channel:entries channel="yourchannel"} <img src=".." /> {if count != total_results} {switch='|||||||</div><div class="item-container">'} {/if} {/exp:channel:entries} </div>


3

No, even though we use the same hooks as the Pages module EE has no parameter for that. Here are all of the available parameters for the channel tag: http://ellislab.com/expressionengine/user-guide/modules/channel/channel_entries.html#parameters


3

If you use the {url_title} for the href that should do the trick: {exp:channel:entries channel="blog" limit="10"} <li><a href="{url_title}">{title}</a></li> {/exp:channel:entries} Also you might need to add the dynamic="no" parameter to stop EE limiting the list based on the URL e.g. if you are on a single entry page. If that's the ...


3

Safecracker used to be answer to this but now it is deprecated and replaced with "Expression Channel Form". Have a look at this. Hope this helps. http://ellislab.com/expressionengine/user-guide/modules/channel/channel_form/index.html#logged-out-member-id


3

I'm pretty sure you can just pass in the fieldname the row and column like $data['field_id_X'][rows][new_row_1][col_id_1] = 'row 1'; $data['field_id_X'][rows][new_row_2][col_id_1] = 'row 2'; Just increment new_row_x as needed and match up your col_id_x numbers


3

Yep it is still there. Go to Developer/Channels and edit a channel (or create a new one) - the Maximum number of entries value is the third setting field down on the "Channel" tab (i.e. the first one that appears when you edit a channel). More in the EE documentation. HTH


2

Yes there is! Andrew Weaver's Purgedata plugin will do exactly this. Plugin page on brandnewbox Download EE 2.x version from Bitbucket From his website: Delete content from selected weblogs that is older than a specified time Ideal to accompany FeedGrab, CSVGrab and XMLGrab. It works by adding the plugin's tag to an EE template and visiting the ...


2

This sounds like something that Low Yearly Archive could be used for. http://gotolow.com/addons/low-yearly-archive


2

Check your permissions within the status group. Each group that is creating/editing content needs to have permission to each status. So, if the open status is only available to Super Admins and your account isn't a Super Admin, then it won't show Open as an option for you.


2

You could also use the new modulus operator: {exp:channel:entries channel="yourchannel"} {if count % 8 == 1} <div class="item-container active"> {/if} <img src=".." /> {if count % 8 == 0 OR count == total_results} </div> {/if} {/exp:channel:entries}


2

There are a variety of approaches to this. One tool that always proves useful when trying to serve a wide range of layouts and content from a single template is Switchee. This will usually cover all the bases for you! Plus it's more efficient and flexible than native conditionals. Other approaches to play with (either in conjunction with Switchee or ...


2

I haven't tested this (it's a bit tricky to setup!) but try promoting your Stash tags to the top level of the nesting hierarchy like this... Also with exp:stash:parse you should omit the exp part when you get variables (I think you can get away without parse="inward" with this method too). {exp:stash:set name="groups" trim="yes" parse_tags="yes"} {exp:...


2

I would suggest you use EE categories for your product categories rather than channels. Each product tile is an entry in the products channel, and each tile is assigned to one or more categories which determines which product grid it shows up on. The index/category page is then just a list of the categories in your product categories group, and the product ...


2

Almost there, take a look at the available parameters and variables, here: http://ellislab.com/expressionengine/user-guide/add-ons/channel/channel_entries.html {exp:channel:entries channel="vacancies" author_id="CURRENT_USER" limit="1" dynamic="no"} {if no_results} there are no entries in this channel {/if} {/exp:channel:entries} When using CURRENT_USER it ...


2

This is most likely caused because a "Status Group" isn't selected for the channel. To check this, go to Admin > Channel Administration > Channels, then click on "Edit Group Assignments" for the channel having the issues. Your channel probably has "None" set for the "Status Groups". Change that to "Default Status Group" and click the Update button.


2

I can't say for certain how it would pan out in the real world but the entry_id column in the database is an unsigned 10 digit INT so technically there is a limit there. But it's pretty big. You should be OK until your 10 billionth entry.


2

That's a lot of data so in addition to server performance, you want to consider client-side performance and the page weight. You could eliminate or minimize the server-side issue with long caches or using Varnish, but you'll still have a lot of data transmitted and potentially client-side heavy page. I'm guessing that the visitor only cares about info for ...


2

You should be able to do this by changing the expected content of your field from a number/integer to "any" which is basically a string and so will not be treated as a number.


2

The default number of entries returned by exp:weblog:entries is limited to 100. You can set a limit parameter to whatever you like and over-ride this limit. {exp:weblog:entries weblog="listings" dynamic="no" status="not closed" orderby="title" sort="asc" limit="400"} Be aware that there is a also chance you may run into memory and performance problems ...


2

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


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