20

$this->EE->config->item('site_id'); Or config_item('site_id');


16

The best way to do this is to use a .htpasswd file to prevent anyone (including spiders) from seeing the site if they are not authorized. This is much better than a robots.txt file because unlike robots.txt - it cannot be ignored. If a spider doesn't have your password, they cannot view the content. I typically like using a single, shared login for viewing ...


7

I actually use the following along with Focus Lab's master config: First I create php file called robots.php in root and I add the following to it: <?php header("Content-Type: text/plain"); require_once('../config/config.env.php'); echo "#".ENV_FULL." version of robots"; ?> <?php if(ENV != 'prod'): ?> User-agent: * Disallow: / <?php endif; ...


4

Any ft files in the root of your package directory (system/expressionengine/third_party/your_package) will be recognized as part of the package. See P&T's Field Pack for an example.


4

From what I can gather, I would simply get the field_id from the exp_channel_fields for the relevant relationship channel field that has been created inside EE CP. I would then insert both the pieces of content (the main piece of content and the relating content) into exp_channel_data as usual, then get the entry_id's for both pieces of content. Since EE 2 ...


3

I've very little experience with Drupal since 4.x many years ago, tried to get into it at 6.x and 7.x the last being 2 years ago. Ultimately went with ExpressionEngine 2 (had 1.6.x experience in the past for this). That said here are some thoughts. Templates - these can be flat files, you can use the administrative control panel to sync between the ...


3

If you are in an extension, it's possible that the db class is in the midst of a query. I'll show an example. Let's say this was the core EE code: ee()->db->select('some_column'); ee()->db->where('some_column', 1); // your code gets called here, while the active record methods have already been invoked ee()->extensions->call('some_hook');...


3

Can you define what you mean by "a modern CMS"? Any database driven system will face similar problems when using Git source control. This isn't specifically an ExpressionEngine problem. The only systems that wouldn't suffer this difficulty are those using flat file architecture. I often use Git with ExpressionEngine. The only possible sticking point being, ...


3

There is no documentation on this. Think of a fieldtype not as a single input or textfield, but as a single piece of data. So you could build multiple fieldtypes as separate files and folders (and completely different add-ons) or there's a couple of other ways to approach it: either storing the data in channel_data table as delimited or serialized data (for ...


3

I think it's safe to say that testing at this level isn't very common in the EE community (given that no one has answered this question in the past 6 months). It would certainly be possible to set up Cucumber with EE, although I have not tried it myself on an EE site. You will need to address a few issues first, such as setting up multiple staging/test ...


2

Nathan, the first answer on this Q/A explains the standard method of development. Generally when you get the point that you're at, it makes sense to use a versioning tool such as Git and develop locally, deploy to Dev and/or Staging for testing and finally to Production. It's a little scary to begin with but I've had to adopt just this approach in the last ...


2

I've managed to get it working with the following function below, which gets called after the main bit of data is inserted for the channel entry. It simply builds the relationship and then adds the relationship value to the correct field in exp_channel_data public function add_cocktail_relationship($entry_id, $ccms_data) { if (isset($ccms_data['tags']) ...


2

Can you try by setting within config file: $config['log_threshold'] = 0; Sorry, I didn't try it so not sure if would work for you. === The "log_threshold" setting is detailed here in the docs: https://ellislab.com/expressionengine/user-guide/general/system_configuration_overrides.html#log-threshold


2

I've created a bug report at Ellislab and Robin Sowell replied with: "And yep, I’ll pass along your request re: turning it off." So maybe the feature will be included in 2.6.2


2

The real value/power of EE is in the control panel, and how quickly you can pull together complex data-driven sites by not having to build an admin interface. I'm currently building a mobile app that uses a combination of Meteor and EE, and the real reason I opted for EE as a back-end solution is because it would save weeks of work using what EE does ...


2

It's really a matter of "it depends" There are a lot of factors that can help you determine whether EE is good as a long-term platform for a site, so there's no clear answer. You have to look at what you expect your architecture to be like and determine how much bending of EE it will take to make it work. In some cases, it works just perfectly, in others, ...


2

That which is not portable in the database can be set in the config.php see http://ellislab.com/expressionengine/user-guide/operations/moving.html You can write a script to set these dynamically based on the current server, that way you can use the same config online or offline. (also the database connection settings will need to match if they vary between ...


2

Let me be 100% clear that I am not even close to an expert on this, but I've recently started using the development workflow described on Krasimir Tsonev's blog in order to enable a local development process. http://krasimirtsonev.com/blog/article/Deploying-ExpressionEngine-based-site So in addition to what is already suggested in terms of saving templates ...


2

No worries anymore, as EE 5.x is open source and doesn't need a license.


2

P+T are unsurprisingly focusing on Craft CMS, which they created a few years back. Craft has many similarities with EE and it seems that - at least as far as the online slack community goes - many EE mages are now also working on / with Craft these days. If others have moved on to other CMSs - in part this must be due to problems associated with the ...


1

@derek-jones Thanks for the nudge... I ended up with the following in mine. /* |----------------------------------------------------------- | Database and Multi-environment |----------------------------------------------------------- | You can have whatever environments you need. | First, build out your environment arrays. | Then set your $...


1

In your dynamic config, define the $config['database']['expressionengine'] group conditionally. Have a look TJ Draper's dynamic config, specifically these lines // Set up the database $db = array( 'hostname' => 'localhost', 'dbdriver' => 'mysqli', 'dbprefix' => 'exp_', 'pconnect' => FALSE ); // Require environment config file ...


1

Greg is right - javascript is primarily a front-end resource: you use it to program activity within the user's browser. While you can construct EE Sites that don't use any javascript at all - if you want to include any kind of locally dynamic behaviour (UX / UI) you'll need some kind of javascript running somewhere. So it is hard to imagine that you ...


1

As long as you have a valid license, there is no issue with duplication. Just use the license for your development environment, and push it to the production environment. If you already have production set up, just clone the repo to your development environment. EllisLab is not made up of monsters; many people run EE applications with a duplicated ...


1

We start building before our licenses are purchased. We just put in a random number until we actually get the real license. EE doesn't currently do an authorization call on install to validate your license. We use stuff like: 1234-1234-1234-1234.


1

You can source control all templates as you can set them to be saves as files. The only thing you'll have an issue with is the db but show me a db driven cms for less then $10k that does that well. There is heaps of info out there on how to run a EE site with GIT, a small bit of googling will get you there but many many of us run it in GIT very nicely ...


1

Well, I am biased but I use my own Channel Data library for just about everything. I just re-wrote it entirely with full CRUD support, and will save you loads of time. Not familiar with Bjorn's solution, so I can't comment either way. I would advise against this. When you upgrade EE, you will have to constantly backup specific files and ensure they aren't ...


1

A "channel segment" or a URL segment? In case of URL segments, you can protect the templates using: {if 0 == logged_in_member_id } {redirect='404'} {/if} Or you can restrict the access to the templates by CP.


1

This is not a Matrix issue, but a Zoo Visitor template tag issue. Here's the winning code per comments posted above. I'm posting here for all to see. {exp:channel:entries entry_id="{zoo_visitor_id}" status="not closed" limit="1"} {exp:zoo_visitor:update_form} Company Name: <br /> <input type="hidden" name="member_companyname[row_order][]" ...


1

Just found a way to avoid this problem I change the hook from cp_js_end to the cp_menu_array hook. Will work function cp_menu_array($menu) { print_r(ee()->session) } Please make sure that you not returning your JS but add your js with to the with ee()->cp->add_to_foot('<script type="text/javascript"></script>');


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