Hot answers tagged

11

Why not just delete the Channel?


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}


6

You can do a bulk update of URL Titles with SQL like: UPDATE exp_channel_titles SET url_title=REPLACE( LOWER(title) , ' ', '-') WHERE channel_id=1 You can see URL Title is being derived from Title replacing space with dash and changing in lower case. You can have channel_id and any other condition in WHERE according to your preference. You can have second ...


6

The "limit entries by status" setting for the Relationship field controls what entries are available to select in the control panel - not what entries will display in your templates. So if you have the field set to "any status", and you've selected child entries with both "open" and "featured" statuses, then your tag will need an explicit status parameter: ...


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

Your first 2 tokens are both month tokens. Essentially you're outputting "February February 2013". Try %F %j %Y or %F %d %Y instead. (See PHP date formatting tokens.)


4

You might use "Low Alphabet" See the tags from here: http://gotolow.com/addons/low-alphabet/docs/tags For last_name, just pass parameter orderby="last_name" within {exp:low_alphabet:entries}


4

http://ellislab.com/expressionengine/user-guide/modules/channel/channel_entries.html#date-heading completely missed this before, but should make this more than possible. EDIT In response to the above comment, a better formatted view: <ul> {exp:channel:entries channel="blog"} {date_heading display="monthly"} <li>{entry_date format="%F"} &...


4

Best bet might be to go through the database tables and look for any entry_id fields. Those tables have foreign keys on entry_id (or just dependencies) and are where you need to track down loose ends. For example, if you have comments enabled, you'll need to delete from exp_comments first: Delete from exp_comments where entry_id in (Select entry_id from ...


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

exp:query would be a fairly painless way to check how many categories (if any) the two entries share. The count(*) could be changed to cp1.cat_id if you'd rather retrieve the category id from the query. {exp:query sql="SELECT count(*) AS count FROM (SELECT cat_id FROM exp_category_posts WHERE entry_id = {first_entry_id}) cp1 INNER JOIN (SELECT cat_id FROM ...


3

This SQL will clean up both exp_channel_titles and exp_channel_data: DELETE exp_channel_titles, exp_channel_data FROM exp_channel_titles INNER JOIN exp_channel_data ON exp_channel_data.entry_id = exp_channel_titles.entry_id WHERE exp_channel_titles.channel_id = 5 AND exp_channel_titles.status = 'your_custom_status' Replace the channel_id and status as ...


3

You might see this article http://www.sidd3.com/get-entry-revisions-in-expressionengine/. I hope, it would help you.


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

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

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

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

Try appending this &perpage=1000


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

You can do this a couple ways. One quick method is to either use the record status and add 'topStory' as a status, along with 'open', 'close' and other statuses. Then to use code like {exp:channel:entries channel="news|press" limit="1" orderby="date" sort="desc" status="topStory"} <div class="topStory"> <h2>{title}</h2> <p>{...


2

Use snippets instead of global variables so that you can use them in the parameter of the channel entries tag, as the snippet will get parsed early. It seems like a good strategy to do this like you said, preparing snippets like "abc1|abc2|abc3" for all the different channel groupings you'll need and then: {exp:channel:entries channel="{snippet_abc}"}


2

You can probably do this with Stash. I haven't tested this code, but it should work. First, output/stash the entries by date. {exp:channel:entries orderby="date" ...} {exp:stash:set_list name="entries"} {stash:title}{title}{/stash:title} {stash:is_recent}{if count < 11}true{/if}{/stash:is_recent} {/exp:stash:set_list} {/exp:channel:entries} ...


2

Try to use embed to set and pass ahead a variable: {embed="template_group/.entries-list" eleventh="{exp:channel:entries offset='10'}{edit_date format='%U'}{exp:channel:entries}"} On the embed template: {exp:channel:entries} {if {edit_date format="%U"} < {embed:eleventh} } <custom markup> {/if} default markup (...) {if {...


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