php - Block in drupal - prints nothing, what's wrong with my script? -


I have a block, which I want to show the edit and delete buttons for the use of users, and the rest of the other buttons Am users I am using this script with the update permission to users:

  & lt ;? Php if (arg (0) == 'node' & amp; is_numeric (arg (1))) {// load $ node object $ node = node_load (arg (1)); // Check for node update access (node_access ("update", $ node)) {Print '& lt; P & gt; & Lt; A href = \ ". / Edit \" & gt; Edit & lt; / A & gt; & Lt; A href = \ ". / Delete \" & gt; Remove & lt; / A & gt; & Lt; / P & gt; '; }}? & Gt;  

This is the same script I used on other blocks for block visibility, and it works. Why is not it working here?

I tested your code on a Drupal 6 site and it looks like the link URL works well I see two links named "Edit" and "Delete". Are you sure that you have enabled the block in any area, and this area is displayed in the page. Pl.pl.php? (You can see this by putting another block in the same area and see if it is visible.)

To get the right link, I use the L Work like this:

  & lt ;? Php if (arg (0) == 'node' & amp; is_numeric (arg (1))) {// load $ node object $ node = node_load (arg (1)); // Check for node update access (node_access ("update", $ node)) {$ nid = $ node- & gt; Nid print l (t ('edit'), "node / $ net / edit"). ''. L (T ('delete'), "node / $ net / remove"); }}? & Gt;  

Note that I am also using the t () function to make "edit" and "delete" translatable.


Comments