Images in Drupal RSS Feed, without additional modules

There is an easier way to include the image associated with your node in a Drupal Views RSS feed. No additional modules are required.

Firstly you need to add the Media RSS namespace to your views-view-rss.tpl.php:

Secondly, in the row style template for your RSS feed (mine is called views-view-row-rss–market-news-rss-feed–feed.tpl.php), you need add a media element, and enter your image field name, your image style, and your dimensions:

Lastly, make the field data available to the template above by adding the following to your template.php

Thanks to these guys for the inspiration:

Drupal: How to access fields in html.tpl.php

When developing my AMP subtheme for Drupal 7, I wanted to only include the amp-youtube extension if the current page actually contained a YouTube video. The amp-youtube extension javascript can only be included in the HEAD of the HTML document, so in Drupal, your html.tpl.php must know about content which is usually only available at node.tpl.php level. Here is the solution:

In your template.php

in your html.tpl.php

 

Curata and Drupal Integration

So you want to integrate Curata with your Drupal site? Here’s how:

  1. Install BlogAPI, and Services modules
  2. Enable the above modules, and also “MetaWeblog Provider” and “Old Blogger Provider” for Blog API, and the Services, “Services XMLRPC Server”.
  3. Under Home » Administration » Structure » Services create a new endpoint of type XMLRPC, both name and endpoint URL should be “curata”.
  4. Under the resources tab of your newly created service, check all boxes under “blogger” and “metaWeblog” sections.
  5. At this point you might want to create a new content type for articles published from Curata, it should only contain title, body, image* fields. Having fields other than these, which are required fields, is a problem because will be left blank and therefore prevent Curata from being able to publish. I created a content type called “Curata Article” and referenced it in the step below.
  6. Next you need to create a Role within Drupal, the only permissions it requires are “Manage content with BlogAPI”, “Administer content”, “Curata Article: Create new content”, “Curata Article: Edit any content”, “Curata Article: Delete any content”. Now create a user with this role assigned.
  7. In Home » Administration » Configuration » Web services  » BlogAPI, set the default provider to “Blogger” and select the content type you will allow Curata to publish to, probably the “Curata Article” content type you created in step 5.
  8. Now you’re ready to hook up Curata. Login and go to CCS. Under the share menu, click on CMS then “Add CMS channel”.
  9. Enter your Drupal website URL, the “discover” feature will fail because, unlike WordPress, XMLRPC is not advertised to the world.
  10. Enter your endpoint URL, should be https://www.example.com/curata and provide the credentials for the user account you created in step 6.
  11. Click the authenticate button and Curata will connect and get a list of Content Types it can publish to, as defined in step 7.
  12. The rest of the Curata settings are down to your personal preference. Save all changes and then share some of your approved content from within CCS, ensure it appears in Drupal and you’re all set.

* I have not been able to get Curata to publish images directing into Drupal. To get around this you can edit your “Post Body” field in the Article Display settings within Curata. Here is my post body template:

 

Running Acquia DevDesktop under a different user account

So I recently found, due to corporate IT policy, my local admin/elevated privileges had been removed, and therefore I was unable to run Acquia Dev Desktop.

After having corporate IT support enter their administrative credentials, i found my local Drupal site was displaying the “Install Drupal” screen, rather than my local website. This screen is usually displayed when the local database is empty, but after checking my PHPMyAdmin, i could see this was not the case.

Maybe the new username account used to launch Dev Desktop didnt have permission to access the database, or could even see it? Correct, here’s my solution:

I copied this file:

C:\Users\My_Username\.acquia\DevDesktop\DrupalSettings\loc_[sitename]_dd.inc

…to the folder for the new user who has permission to launch DevDesktop:

C:\Users\New_User\.acquia\DevDesktop\DrupalSettings\loc_[sitename]_dd.inc

(The above folder was previously empty)

And, BOOM, now the local Drupal site runs successfully.

 

Drupal and CKEditor, setting default values in the image properties dialog

Copy this file to the root of your theme directory:

/sites/all/modules/ckeditor/ckeditor.config.js

Edit the file and add the following code which will give a default value to HSpace, VSpace and ensure Bootstrap’s “img-responsive” class will be added to all images:

Lastly, edit your CKEditor profiles and set “Load ckeditor.config.js from theme path” to “Yes”:

/admin/config/content/ckeditor/edit/Advanced

Done.

Acquia Dev Desktop – Sharing your local site

If you’re developing a Drupal site locally, using Acquia Dev Desktop 2, and you need to allow your co-workers to see it, you’ll need to make the following change to your vhosts.conf (located in devdesktop\apache\conf\vhosts.conf)

Replace “Require local” with “Require all granted”, then stop and restart Apache/MySQL from within Dev Desktop.

 

New Apartment Checklist

Things to check and look out for when moving to a new apartment:

  • Check the water pressure on cold, on hot, on both, and how long it takes to get warm, shower and bath too.
  • Check if you fit under the showerhead!
  • Find out who does the maintenance (some handyman, a legit company, the landlord?). What are their policies on work orders? Can they be submitted online? What is their response time guarantee for after hours emergencies? If it’s just a single landlord and not a property management company, do they have someone you can call when they go on vacation and the hot water heater breaks?
  • Go to the property at night and see what the noise is like
  • How much notice the landlord has to give before showing up
  • Inspect tops of cabinets, behind stove/fridge, for poop. If there are red/brown stains in the corners where the ceiling meets the walls, it’s bed bugs. If there is a line of white powder along the baseboards, it can mean roaches, but more likely bedbug treatment has been performed. White powder behind fridge, stove, etc. is usually boric acid or diatomaceous earth used to treat roaches. Brown or tan kernel sized paste is also used against roaches. Check the Bed Bug Registry online and ask if the building has a history of any pest problems.
  • Signal on your phone
  • Learn about the community by looking at how the treat the dumpster area
  • Research state tenant’s rights laws
  • Make sure you’re completely clear on all terms of the lease and know what utilities you’ll be paying and what payment method you’ll need to use.
  • Make sure there’s an Internet provider suitable to your preferences.
  • Google your potential new landlord. Look up online property records in the county you are in. Slumlords will generally have lots of liens against them and/or have multiple properties in foreclosure.
  • Assure the windows are double-paned/double-glazed and in good repair if the area is cold to avoid high heating bills. See if the windows open and close easily.
  • Be wary of any musty smells that could indicate water damage. Too many air fresheners may be an attempt to hide this.
  • Fill all sinks/tubs. Drain simultaneously and flush each toilet during.
  • Check your responsibilities as a tenant. After moving in many landlords require you to pay the cost of a stopped up toilet, pest infestations, and require you to shovel snow from sidewalk/mow the grass on areas around the house, or clean gutters. They may also require you to pay the cost to fix supplied appliances.
  • If surrounding places have belongings left sitting on the porches (toys, stoves, seating, decorations), it’s a good sign for little/no theft and a kid-friendly environment.
  • If the leasing agent or landlord promises to do something before you move in, it needs to be written into the lease or it may not happen.
  • 1st floor apartments are most convenient for thieves, and the most frequently broken into.
  • If there’s a homeowner’s association, find out its rules.
  • Find out the policy on smoking, pets, noise, and visitors.
  • If you must break the lease, what are the consequences/options?
  • What’s the average rental time for apartments in the building? If people aren’t staying long, it’s a bad sign.
  • Count the number of outlets in each room
  • Is there a recycling dumpster?
  • Ask where the circuit breaker is and if you can look at it. This is an important thing for you to know about in the event of a power surge or tripping a breaker. When you open the breaker box, just make sure it isn’t completely filthy and it looks like everything is capped and has functioning switches. Ask which ones are for your apartment if you have a shared breaker.
  • Ask how the unit is heated and cooled during the appropriate seasons. If it is a gas heating unit, your apartment will dry out a little more than a fully electrical one so you’ll want to have a humidifier. Ask the last time the system was serviced and make sure that you have a carbon monoxide / gas detector. If you will be using window AC units, be sure they can be removed during the winter and that, when in the window, they get sun during part of the day. If not, they will fail to dry out properly and can collect mold.
  • Smoking: If you are a nonsmoker you’re going to want to be sure your apartment has either never had a smoker in it or has been properly cleaned since an indoors smoker lived there. If a long-term resident also smoked indoors, the smell will have permeated in to the walls, carpet, and even the cabinets depending on how long they lived there and how heavy they smoked. Make sure the carpets have been professionally cleaned and open cabinets and closets and sniff for smoke smells. If you smell them, minor cases of bad smoke smells can be fixed with a new coat of paint and steam cleaning the carpet. Is the building “smoke free”?
  • check that there aren’t a million petty signs up in the lobby telling you what you can’t do – trash, noise, parking etc. It’s a giveaway that your neighbors are gonna be a problem.
  • Check out what the heat source is (if you live in a place with cold winters)
  • Make sure the windows are double pane. You lose tons of heat from windows as it is and single pane is only going to make it worse
  • Escape route in the event of a fire.
  • Check that the elevator works
  • Is the deposit refundable? Are there any nonrefundable deposits relevant to you?
  • What methods can I use to pay my bill?
  • Can you paint/hang pictures, and if so, what are the expectations on move-out?