Hot answers tagged

6

Remove safecracker_file from your third_party directory. It has been deprecated (now rolled into the standard File fieldtype).


6

Conditionals based on URL Segments is how I would handle this. For your example, I would have in my books/chapters a conditional like {if segment_2 == "summary"} {embed="embeds/summary_code"} {/if} I'd use an embed just to keep the template cleaner — instances where I do this do tend to be on more complex site where I like keeping things as clean as ...


6

Your option is a good one and not hard at all. Instead of expiring the entries, I would future date them and set limit="1" on your channel:entries tag. This way an entry will always appear. With expiring you risk human error causing an image not appearing.


5

The channel entries tag is a bit special in that, by default, it looks at your URL to determine how and whether to filter the entries that it returns. You can switch off this dynamic behaviour with the dynamic="no" parameter. Primarily, the tag will filter itself down to entries matching a url_title contained in segment_2 or segment_3 (bear in mind that ...


5

I recommend using SEO Lite. It will save you from having to open up a channel:entries tag just to grab the title. Plus it can be used for a meta description tag (which is also useful for og:description and social share text). And it has a variety of useful parameters to help you pull the right title and to add prefixes or suffixes to your title. Just ...


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

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

It appears that the behavior you're experiencing is an accepted bug, at least for the status. See the bug tracker. There doesn't appear to be a fix posted, but you could potentially create the status and category fields as hidden inputs, if security isn't a big concern.


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

If you turn on the Output Profiler, you will be able to see the list of SQL queries generated for any page.


4

Another simple idea... Name your images like this: December-1.jpg December-2.jpg December-3.jpg Manually upload the images to the server... in your template call image like this: <img src="/path/to/images/{current_time format="%F-%j"}.jpg"> The image for the current day will always be called. EE date formatting options are here: http://ellislab....


4

You need to ensure that you have created a Channel Field Group and assigned that to your Channel (News). Then, make sure that you have created at least one field in your Channel Field Group. In this case it would be a Textarea Field Type with a name of body. Then in your Publish/Edit screen for your Channel you'll see your new Body field. Once you enter in ...


4

You need to use the require_entry parameter: {exp:channel:entries limit="1" require_entry="yes" [...]} {if no_results} {redirect="404"} {/if} [...] {/exp:channel:entries} This parameter make the {if no_results} conditional available.


4

Form layouts is where you can setup the input form and fields for entering data via the Create or Edit entry pages. You can save a layout for specific users per channel so that a given user will see the entry form that you have saved to a layout. In this way, you can reorder or hide fields as needed. For example, say you have a user that you don't want to ...


4

Yes, this is possible. You can do this by making simple template and embed. Create one template template_name.html in your template group and insert below code. {exp:channel:categories channel="channel_name" disable="category_fields"} ******************************************************* <br> Category Name : {category_name} <br&...


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

If you have Wygwam installed, I'd recommend taking a look at GWCode SyntaxHighlighter. http://gwcode.com/add-ons/gwcode-syntaxhighlighter It's served me well for years now, and since it's integrated as a Wygwam toolbar button, it allows you to mix prose and code all in one single field. Cheers, John


3

Create a category group in EE called "Cars" (assumes cat group ID of 2 in code below). In there you create categories with the Make. You then create child categories of each Make with the relevant Model. You can then create children of the models if there are variants of the model. Channel Categories Main landing page template has this code: {!-- MAKE --} ...


3

The Channel URL setting is intended to mark the URL of the channel itself, not of just one of its entries. You should use the Pages Module for this.


3

If you don't want to use channels, use low variables with a grid field with days of the week as the grid rows. Give each a file upload field and an alt field then use some logic on the template to get the day and call the low var for that day. Simple example, not verbatim code purely reference Grid field: date_1 | imgxx | alt title date_2 | ...


3

Yes, use the Publish Layouts feature. You can drag and drop fields into place and adjust their widths as you please.


3

Yes, you can pull content across sites. That the site setup process allows you to copy an existing site doesn't change that. You can embed templates across sites using an embed statement: {embed="default_site:embeds/html_header"} I'm not sure what you mean by sharing templates via a symlink.


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

Alec's method works, but it might cause very high query counts due to the way EE generates nested Channel Entries tags. Take a look at the alternative method outlined in this post from EE Add-on superhero (and parse order master) Low. It achieves the same thing, but is much more performance friendly: http://gotolow.com/blog/nesting-tags-and-performance-in-...


3

As per your comments, you've already figured out the rather large annoyance of needing to pass all pre-existing fields with the save_entry function or else having them wiped out. I wanted to post an answer here though because there are a couple considerations I've come across when doing entry updates with my add-ons: 1) If you do not need the update to ...


3

With - http://ellislab.com/expressionengine/user-guide/add-ons/channel/entry_linking.html {exp:channel:next_entry} <p>Next entry: <a href="{path='site/comments'}">{title}</a></p> {/exp:channel:next_entry} {exp:channel:prev_entry} <p>Previous entry: <a href="{path='site/comments'}">{title}</a></p> {/exp:...


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

Thanks to @Nevsie-Modeten, I reworked the query to the following: {if {current_time format='%w'} == 0 && {current_time format='%G%i'} >= 930 && {current_time format='%G%i'} <= 1230 } Content to be displayed during this time. {if:else} Content to be displayed during other times. {/if} This checks the day and time and ...


3

The simplest and and most flexible way is to use Template Layouts. In your main HTML Layout wrapper (simplified) which we will say is named "_html-layout" in the "layouts" template group: <html> <head> <link rel="stylesheet" href="/css/global.css"> {layout:css_extra} <head> <body> {layout:contents} </body> &...


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