Archyvas

Įrašo tag'ai: ‘Drupal’

Internet Explorer does not load stylesheet files

Rugpjūtis 25th, 2010 Ernestas Kardzys 4 komentarai

I was creating a website with Drupal CMF and experiencedy a problem: the website is displayed perfectly in Opera, Google Chrome, Mozilla Firefox BUT NOT IN Internet Explorer (both versions 7 and 8) . It looked like that Internet Explorer did not load my custom style.css file.

After some googling I found out that Internet Explorer CAN NOT LOAD MORE THEN 31 CSS FILES FOR SINGLE WEBPAGE. Funny thing, huh? And I had 37 for a webpage. Well, it looks like that the solution is quite simple: to reduce the number of CSS files by copying content of one CSS file to another.

Drupal. RSS feeds

The RSS feeds for your Drupal website can be located at: http://<the_url_of_your_website/rss.xml :)

Kategorijos:Programavimas Raktažodžiai:,

How to get node information in block?

Gegužė 16th, 2010 Ernestas Kardzys Nėra komentarų

I am coding a system for my bachelor theses. And I had & solved a small problem.

The problem. I have to types of content types – Record and Group of Records. If I navigate to Group of Records there should be a block with a link saying “Create a record”. The problem is that I need to pass some additional argument to the form Record (the node ID of Group of Records). So, my link looks like that: node/add/record?groupid=1001. The question: how to get the node ID of Group of Records?

The solution: small if() :)

if ( arg(0) == ‘node’ && is_numeric(arg(1)) ) {
$node = node_load(arg(1));
// Your code here…
}

Kategorijos:Drupal, Programavimas, Studijos KTU Raktažodžiai:, ,

Drupal. check_url() & MMS protocol

Balandis 24th, 2010 Ernestas Kardzys Nėra komentarų

I was coding a small dialog for my bachelor theses. There is a text box where you can enter an URL address. So, before submitting the form I validate that text box with check_url() function.

The problem is, that my address starts with MMS. It’s something like that: mms://www.server.lt/directory/file. So, after check_url() function the result is: //www.server.lt/directory/file. I was googling for the solution and I’ve finally found it.

The problem is in file modules/filter/filter.module file, line 1182. “MMS” is not in the list of allowed protocols. So, there are two posable  solutions:

  1. Edit that line and add “mms”. Well, this is not recommended, because by doing that you’re hacking the Drupal core. So, forget this.
  2. The other solution is to download the module “Filter protocols” (http://drupal.org/project/filter_protocols) and add “mms” (or any other) protocol. This can be done by selecting Site configuration->By module->Input formats. The tab “Allowed protocols”.

Good luck!

Drupal – White Page of Death

I was programming with Drupal and got a very ugly mistake – totally blank (white) screen. After some Googling I found that this can be fixed by increasing PHP memory size. Nope, it didn’t helped.

Then I tried some other tricks, like making a redirection to other page. But no.

The solution was very simple: I had to change text encoding to “UTF-8 without BOM” (I used Notepad++ for that). It worked – no white screen ;)

P.S. It took about 5 hours to understand that :)

Ubercart images do not show up!

Vasaris 19th, 2010 Ernestas Kardzys Nėra komentarų

I have installed latest version of Ubercart (currently – 2.2.) and I had one problem.

I posted a new product, attached image to it, but those images do not show up. Well, and solution is quite simple.

For Drupal 6 you need to enable: CCK, Imagefield, Imagecache, ImageAPI modules and (that was my problem) ImageAPI GD2 OR ImageAPI ImageMagick. I suggest enabling ImageAPI GD2, but it’s up to you and your server configuration.

My impressions about Drupal CMS (or should I say CMF?)

Vasaris 2nd, 2010 Ernestas Kardzys 4 komentarai

The more I read about Drupal Content Management System (Framework?) – the more I like it :) It’s very flexible, provides good API and well documented :)

But why it’s not object oriented?..

Kategorijos:Programavimas, Studijos KTU Raktažodžiai:, ,