Linked Questions

9
votes
3answers
31k views

How to get jquery working on Drupal 7 - for Newbies

I have been reading many tutorials online on how to get jquery working on drupal 7. Although there are many lines of code and examples, what i cannot find is what piece of code to put where (maybe it ...
15
votes
4answers
6k views

Managing blocks in a responsive theme

I'm just starting a responsive theme based on Omega, concentrating on the mobile layout at first. There are certain blocks that will probably be deemed too 'heavy' to include on the mobile layout, ...
3
votes
4answers
2k views

Will the PHP filter prevent SQL injection attacks?

I had trouble getting the form API to work though I am considering re doing all my forms with it. I have some custom html/php forms however I directly insert into the DB using pg_query. I am looking ...
6
votes
6answers
3k views

How to display a block on only the listed pages using wildcard and excluding subpages?

I have a block I'm displaying using block setting's "Only the listed pages". I'm using a wild card asterisk to show the block on any pages following about-us/. For example: about-us/* The problem is ...
4
votes
3answers
1k views

PHP in database: bad practice but

Lots of times here I've been told that using views custom php fields, filters or others is a bad practice, because putting php in the sql is dangerous. My question is, if you only call to a function, ...
3
votes
3answers
7k views

Block within another block

In drupal 7, I want to render block into another block, for example block-1 into block-2. I guess I should put some PHP code into block-2, but I don't know what the code could be?
4
votes
4answers
5k views

Drupal 7 CKEditor doesn't show javascript

I have Drupal 7 with CKEditor 3.6.2.7275 under Wysiwyg module. In configs of Wysiwyg I unchecked all the checkboxes for "Cleanup and output" category. Plus unchecked "Limit allowed HTML tags" for Full ...
3
votes
2answers
1k views

How to enable PHP in a field?

I have created a content type in Drupal 8 and I added a field named "body". But I'm unable to use PHP code in this field. How can I enable PHP in my "body" field?
1
vote
3answers
11k views

How do I put the copyright / name site in footer

In the four themes I tried before choosing the one I have now, the name of my website was always featured with the copyright in the footer of my webpages, but now all it says is "Copyright © 2013, ." ...
3
votes
3answers
2k views

How can I define a selection rule to use for Panels variants in code?

I have some custom PHP code that I would like to use as a selection rule for about 30 different variants. In the future, I may need to update this code, so rather than add the code 30 times, once for ...
1
vote
2answers
2k views

drupal and php code

is it standard or good way to put code in block with php fiter format and use another drupal benefit (handling users,contents,roles,another modules)? for example i need to use jquery ui dialog. i ...
2
votes
2answers
1k views

Alternative to drupal_goto() function?

I need to use an alternative function to replace drupal_goto(). The reason is that this function is causing me a problem to run cron.php. The code is: if(is_int($order_id)) { $path = 'admin/...
4
votes
5answers
516 views

How to stop a Views block from displaying to administrators, such as user/1?

I created a view and put an access role of anonymous user. When I log in with normal user account I don't see it, but when I log in with my admin account I see the view. I would like to not see it. ...
0
votes
3answers
5k views

drupal 7: new field with dynamically generated select list from PHP code

I have a new node type where a user is asked who he or she knows from the site. They are to be presented with a select list with the names of the existing users on the site. When creating this new ...
0
votes
3answers
6k views

How do I display tokens in a block using PHP code?

What is the way to use tokens in PHP code? I need to show the user profile picture URL, but the following code doesn't work. <?php echo "[current-user:picture:url]"; ?> How do I display ...

15 30 50 per page