Hot answers tagged

8

You can do this without editing the Wygwam source. First you need to create a custom config file for CKEditor. Create a JavaScript file called something like 'ckeditor_config.js' and then set Wygwam to use it. You can do this by adding an advanced setting to your Wygwam editor configuration. Add the 'customConfig' setting and enter the path to the JavaScript ...


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


4

A few embeds never hurt anyone, despite the hype! Yes they can have a performance hit on busy or content heavy/intensive sites but for smaller sites you'd probably barely even notice, save for a few extra queries on page load. You can always use Snippets instead of embeds if you want to segmentate your code into smaller chunks. Saying that, as you're only ...


4

We use this code in our header embed; allows us to do something like {embed="site/_header" meta_title="Example Title"}; alternatively we can specify an entry ID, and SEO Lite will figure out the correct info, or, we can just let it rely on the last segment, which works 95% of the time. It's worth noting that we're also using Mark Croxton's IfElse add-on ...


4

This way is not possible because of ExpressionEngine’s Parse Order Parse advanced conditionals Process embedded templates With your code you don't have "yes" in conditionals when EE parses it, you have "{embed="test/foo"}"


4

As I told you earlier today, this is not a Low Search issue, but a conditionals parsing issue. If you turn on Template Debugging, you'll see the opening tag just before it is actually executed. It will look something like this: {exp:low_search:results {if embed:author_id}author_id=""{/if} ... } That is what's executed, and what EE uses to set the internal ...


3

Not natively I believe. I typically use Stash to do this nowadays. It will give you persistent variables as well as template inheritance so you can do things like this. Wrapper template <!DOCTYPE html> <!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ --> <!--[if IE 7]><html class="no-js lt-ie9 lt-ie8" lang="...


3

Another option that I have used in the past is with Playa: Create as many channels as you need modules (text, events, video, 1 big image, image gallery, etc.) and enter content Create a "page" channel with a playa field linking to your modules channels. Use conditionals / ifelse / switchee to test on the channel_short_name and display module fields: ...


3

I believe to do so, you would need to create a Custom Style Set for Wygwam. See the Wygwam Docs over a Pixel & Tonic. Though, I recommend creating a class instead of an id. Since someone will most likely add more than one media embed sometime in the future. Additionally, this StackExchange post deals with editing the Wygwam .js for custom sets.


3

Why not do it the other way around, where the template being loaded is what actually contains the complex logic? Then you can embed the rest of the template, passing the entry_id via an embed parameter. Alternately, write a simple plugin which performs your logic and returns the entry_id, then put your Channel Entries tag inside of that plugin tag pair (...


3

Stash 2.4.3 corrected a long-standing inconsistency with embeds set to process at the start of template parsing. At the other stages of parsing (inline and end) embeds are parsed by default - that is to say, parse="yes" is the default parameter value if not specified, and 2.4.3 added this as the default for start too. To make your embed behave as it did ...


3

Snippets are not intended to be used by / known by end users. They are developer tools for making your code more DRY - not so much to hold content. This is why the access to them is through the Templates area of the CP rather than the Content area. Here is one approach to allowing users to create different sidebars - note that you could use the native ...


2

I have discovered what was happening, and it turns out I was actually having two different problems. The embedded template was not showing up because I needed to add the parameter dynamic="no": {exp:channel:entries channel="events" limit="1" url_title="{segment_2}" dynamic="no"} <div class="video-box"> {embed="templategroup/event_video" the_id="{...


2

Sorry to throw a cat amongst the pigeons but stash is very much a purist approach. Sure there are advantages of it but it takes a multi designed and structured site to a whole new level of complexity. For me and now... Low Variables will do for the performance hit of embeds.


2

You can insert the iFrame code into a normal Content Elements textarea field.


2

Are you sure the embed is needed. Can relationship fields be self-referencing on their own without the need for an embed? Have you tried simply using: {related_entries id="also_like_1"} {title} {/related_entries} Does that not generate the correct output for you? I'm so used to using playa for relationships like that, I can't remember what native ...


2

I would avoid using an embed in that case. An embedded template is the second to last thing to be processed, see ExpressionEngine's Parse Order courtesy Lowe. If you want to re-use that code you can use it in a snippet (and use an add-on like Brian Litzinger's Snippet Sync to manage snippets as files if that's what's been preventing you from using ...


2

Change your quotations: {if '{embed="common/.get-gender-url-title" chosen_gender_id="{exp:stash:get name='chosen_gender_id'}"}' != 'male'} UPDATE Sorry for the crappy first answer. Your issue is, as always, a parse order issue. Embeds are parsed after conditionals, so the conditional is reading the embed code directly (not parsed) as notacouch mentioned. ...


2

Depth isn't an issue with embeds and neither is URLs, so if the embed works from template A, it will work from Template B. So it isn't any parameter issue (unless you use embed variables in the parameters - see 2 below). Three factors that are most likely: The embed in Template B is within a conditional which is not being met. You're passing embed ...


2

The no_results conditional should work, something like: {exp:channel:entries channel="speed_sales" dynamic="no" url_title="{embed:url_title}"} {if no_results} <!-- Content for no results --> {if:else} <!-- Otherwise ... --> <h2>{title}</h2> {if lead_copy}<p class="lead">{...


2

You'll need to wrap your Wygwam field in the Allow EE Code plugin tags within your template: {exp:allow_eecode embed="y"} {your_wygwam_field} {/exp:allow_eecode}


2

This sounds like a parse order issue. It's the sort of thing you could turn into a custom plugin really easily though, and it would avoid creating any SQL injection security issues at the same time. Create a new file third_party/my_plugin/pi.my_plugin.php <?php class My_plugin { public function __construct() { $this->EE = get_instance(...


2

Since I couldn't found nothing that looks like a snippet on your code, you can use one. Save all the internal code of exp:channel:entries tags on a snippet called snip_article and go ahead! If you want a way to edit snippets as plain text files, give to SnippetsSync a try.


2

It sounds like some of those templates have cache enabled? Did you check the template preferences? Go to Templates > Choose Template Group > Click Preferences > Here you can adjust template settings


2

EDIT: Please see the accepted answer above from Dylan as an approach for handling this type of functionality. nonprofit_tech's suggestion to try using a custom style set does work, but it involves a two-step process: the content administrator must first add the custom wrapper from the style set dropdown, and then embed the media via the toolbar's media ...


2

The Variables plugin is a good option for passing data to the header embed. The variables plugin gives the possibility to create variables (either static or dynamic) and use them later on. This means that for example you can set certain data and use it in the head (if it's embedded) without having to re-create a tag pair for the specific channel. ...


2

I'm not sure why you're using an embed for this, you're not passing anything to it so I'd use a snippet for sure. Also may as well use set_list, open the tags above the exp:channel call {exp:stash:set_list name="resources" parse_tags="yes"} {exp:channel:entries channel="white_paper|c_study|video|webinar|data_sheet" limit="8"} {snippet:get_data} {/...


2

In simple terms, that is how you call up the value of a variable declared within an embed tag. So for example, if in your "main" template, you insert an embedded template called sidebar: {embed="embeds/sidebar" the_passed_value="hello"} Then in the embedded template itself, you could have: I would like to say {embed:the_passed_value}. Which would render ...


2

Example 1: In some cases {embed:entry_id} would be most useful by passing an entry_id from the parent template into the embeded one's entries tag pair entry_id parameter to just return the results of the given entry_id. {exp:channel:entries channel="your_channel" entry_id="{embed:entry_id}"} Just the entry that was passed from the parent template. {/...


2

Answer 1: Backup - files and database. Seriously, get that site under source control. If anything goes wrong it's easier to roll back. I'd just go straight to 2.8 -- I did one the other day going from 2.1.3 to 2.8 - if you run into issues then go for 2.7.x It shouldn't break them if you're using recommended ways of embeds and related entries.


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